Host interop fixes: ==/time/subvec/defonce + corpus cleanup
- == 1-arg returns true for any value (Clojure short-circuits before the number check), not 'requires numbers'. - current-time-ms wired to now-millis so the time macro works. - subvec truncates float/ratio indices via long (Scheme quotient rejects flonums). - defonce checks bound? not var-get — in a top-level do the name is already an unbound interned cell, which var-get throws on. - drop the line-seq corpus row (used janet/spit, N/A); allowlist char-array (needs Class/forName "[C"). Corpus 2678->2683, floor raised. Re-minted. Full gate green; CI green. jolt-cf1q.7
This commit is contained in:
parent
dd0e0b55cc
commit
cf0b544baf
7 changed files with 23 additions and 13 deletions
|
|
@ -66,11 +66,15 @@
|
|||
;; 1-arity is trivially true; 2+ args must all be numbers (Numbers.equiv throws
|
||||
;; otherwise). Uses Scheme = (value across the tower), not jolt= (category-aware).
|
||||
(define (jolt-num-equiv . xs)
|
||||
(let all-num? ((ys xs))
|
||||
(cond
|
||||
((null? ys) (or (null? xs) (null? (cdr xs)) (apply = xs)))
|
||||
((number? (car ys)) (all-num? (cdr ys)))
|
||||
(else (error #f "== requires numbers" xs)))))
|
||||
;; 1-arity short-circuits to true for ANY value (Clojure's == 1-arg returns true
|
||||
;; before the number check); 2+ args must all be numbers.
|
||||
(if (and (pair? xs) (null? (cdr xs)))
|
||||
#t
|
||||
(let all-num? ((ys xs))
|
||||
(cond
|
||||
((null? ys) (or (null? xs) (apply = xs)))
|
||||
((number? (car ys)) (all-num? (cdr ys)))
|
||||
(else (error #f "== requires numbers" xs))))))
|
||||
(def-var! "clojure.core" "==" jolt-num-equiv)
|
||||
(def-var! "clojure.core" "symbol?" jolt-symbol?)
|
||||
(def-var! "clojure.core" "keyword?" keyword?)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue