HS parser: is/is-not ignoring case, eq-ignore-case runtime — 423→425

- Parse `is X ignoring case` → (eq-ignore-case left right)
- Parse `is not X ignoring case` → (not (eq-ignore-case left right))
- Compiler: eq-ignore-case → hs-eq-ignore-case
- Runtime: hs-eq-ignore-case using downcase/str

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-13 09:38:12 +00:00
parent eaf3c88a36
commit c05d8788c7
5 changed files with 50 additions and 17 deletions

View File

@@ -388,6 +388,10 @@
(fn (a b) (and (= (type-of a) (type-of b)) (= a b))))
;; ── Sandbox/test runtime additions ──────────────────────────────
;; Property access — dot notation and .length
(define
hs-eq-ignore-case
(fn (a b) (= (downcase (str a)) (downcase (str b)))))
;; DOM query stub — sandbox returns empty list
(define
hs-falsy?
(fn
@@ -399,7 +403,7 @@
((and (list? v) (= (len v) 0)) true)
((= v 0) true)
(true false))))
;; DOM query stub — sandbox returns empty list
;; Method dispatch — obj.method(args)
(define
hs-matches?
(fn
@@ -408,7 +412,9 @@
(string? target)
(if (= pattern ".*") true (string-contains? target pattern))
false)))
;; Method dispatch — obj.method(args)
;; ── 0.9.90 features ─────────────────────────────────────────────
;; beep! — debug logging, returns value unchanged
(define
hs-contains?
(fn
@@ -428,11 +434,9 @@
true
(hs-contains? (rest collection) item)))))
(true false))))
;; ── 0.9.90 features ─────────────────────────────────────────────
;; beep! — debug logging, returns value unchanged
(define precedes? (fn (a b) (< (str a) (str b))))
;; Property-based is — check obj.key truthiness
(define precedes? (fn (a b) (< (str a) (str b))))
;; Array slicing (inclusive both ends)
(define
hs-empty?
(fn
@@ -443,7 +447,7 @@
((list? v) (= (len v) 0))
((dict? v) (= (len (keys v)) 0))
(true false))))
;; Array slicing (inclusive both ends)
;; Collection: sorted by
(define
hs-empty-target!
(fn
@@ -464,11 +468,11 @@
(dom-set-prop target "value" ""))))
((= tag "FORM") (dom-set-inner-html target ""))
(true (dom-set-inner-html target ""))))))))
;; Collection: sorted by
(define hs-first (fn (lst) (first lst)))
;; Collection: sorted by descending
(define hs-last (fn (lst) (last lst)))
(define hs-first (fn (lst) (first lst)))
;; Collection: split by
(define hs-last (fn (lst) (last lst)))
;; Collection: joined by
(define
hs-template
(fn
@@ -554,7 +558,7 @@
(set! i (+ i 1))
(tpl-loop)))))))
(do (tpl-loop) result))))
;; Collection: joined by
(define
hs-make-object
(fn