Chez Phase 1 (increment 3r): dynamic-var constants

host/chez/dynamic-vars.ss binds the two seed-native dynamic vars that aren't
emitted into the prelude: *clojure-version* (the {:major 1 :minor 11 ...} map) and
*unchecked-math* (false). Removes their two run-corpus-prelude allowlist entries
(now 11, all passing).

*ns* is deferred to jolt-b4kl: it needs a namespace value that is not a map yet
answers (get ns :name) for the overlay ns-name, plus str/find-ns support.

Parity 1530 -> 1532/2497, 0 new divergences. emit-test 305/305.
This commit is contained in:
Yogthos 2026-06-18 01:43:16 -04:00
parent 02139af0a1
commit d7420deecb
5 changed files with 41 additions and 4 deletions

View file

@ -609,6 +609,18 @@
(let [[code out err] (run-jolt-chez "(do (defmulti f identity) (defmethod f 1 [_] \"one\") (f 99))")]
(ok "multimethod: no match throws" (not= code 0) (string "code=" code))))
# 3w) dynamic-var constants (jolt-9ls5): *clojure-version* (a map) and
# *unchecked-math* (false) are seed natives, def-var!'d by host/chez/dynamic-vars.ss.
# (*ns* needs a namespace value with get-see-through and map?=false — deferred.)
# (map? *clojure-version*) is intentionally NOT asserted: the seed stores it as a
# mutable table, so its map? is false (a seed quirk); Chez models it as a real map
# (map? true). Not a corpus contract, so the divergence is moot.
(each src ["(= 1 (:major *clojure-version*))" "(= 11 (:minor *clojure-version*))"
"(= false *unchecked-math*)"]
(let [[code out err] (run-prelude src) want (cli-oracle src)]
(ok (string "dynvar: " src) (and (= code 0) (= out want))
(string "chez=" out " janet=" want " | " err))))
# 4) perf signal: emitted fib(30) in-Scheme timing (excludes Chez startup), to
# track against the spike ceiling (hand-Scheme fib ~5ms). Informational — the
# jolt-truthy? wrapper (~3x) and flonum modeling are known Phase-4 levers.