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:
Yogthos 2026-06-21 15:36:41 -04:00
parent dd0e0b55cc
commit cf0b544baf
7 changed files with 23 additions and 13 deletions

View file

@ -122,8 +122,11 @@
`(bound-fn* (fn ~@fntail)))
(defmacro defonce [name expr]
;; only def when the var has no root value. In a top-level (do ...) the name is
;; already interned (an unbound cell) by the time this runs, so check bound? —
;; var-get would throw on the unbound cell.
`(let [v# (resolve (quote ~name))]
(if (and v# (some? (var-get v#)))
(if (and v# (bound? v#))
v#
(def ~name ~expr))))