jolt/host/chez
Yogthos fc6551f877 Chez Phase 2 (inc M): dynamic var binding (jolt-2o7x)
Add the dynamic-binding cluster on the Chez RT: a per-thread binding stack
(host/chez/dyn-binding.ss) backing binding / with-bindings* / var-set /
thread-bound? / with-local-vars / with-redefs / bound-fn* /
get-thread-bindings / alter-var-root + the __local-var seam.

Frames are stored innermost-first as identity-keyed alists of mutable
(cell . value) pairs, so var-set updates the current binding in place. The
two var-read paths — var-deref (compiled code) and jolt-var-get (var-get /
deref on a cell) — are chained onto the stack so a `binding` frame is seen
by every read, with a fast path when the stack is empty. var-cells now hash
by ns/name so a var works as a map key (with-redefs builds (hash-map (var f)
v); get-thread-bindings returns a var-keyed map).

Fix a latent bug exposed once with-in-str could bind *in*: seq? didn't
recognize a lazy-seq. predicates.ss's jolt-seq? predates the lazyseq record,
and unlike the native-op dispatchers it's reached via var-deref, so the
patch must re-def-var! the var, not just set! the top-level binding.

Note: with-bindings* over a hash-map literal now returns the correct Clojure
value where the seed returns a stale one — the seed's PHM can't find a var
key (which is why its `binding` uses array-map); on Chez frames look up by
cell identity.

Prelude corpus parity 1972 -> 2000, floor raised. Gate: _dynbind 24/24,
prelude corpus 0 divergences, full jpm test, conformance 355x3.
2026-06-18 18:29:55 -04:00
..
atoms.ss Chez Phase 1 (increment 3n): seq-native shims + reduced 2026-06-17 23:16:26 -04:00
collections.ss Chez Phase 2 (inc A): collection ctors + real map entries 2026-06-18 10:44:33 -04:00
converters.ss Chez inc 3m: numeric-edge literal emit + variadic assoc! 2026-06-17 22:32:02 -04:00
driver.janet Chez Phase 2 (inc H): volatiles + sequence/transduce 2026-06-18 14:47:03 -04:00
dyn-binding.ss Chez Phase 2 (inc M): dynamic var binding (jolt-2o7x) 2026-06-18 18:29:55 -04:00
dynamic-vars.ss Chez Phase 1 (increment 3r): dynamic-var constants 2026-06-18 01:43:16 -04:00
emit.janet Chez Phase 2 (inc L): var def-time metadata (jolt-zikh) 2026-06-18 17:13:46 -04:00
host-table.ss Chez Phase 2 (inc F): jolt.host ref primitives + sorted collections 2026-06-18 13:14:13 -04:00
jolt-chez.janet Chez Phase 2 (inc L): var def-time metadata (jolt-zikh) 2026-06-18 17:13:46 -04:00
lazy-bridge.ss Chez Phase 2 (inc M): dynamic var binding (jolt-2o7x) 2026-06-18 18:29:55 -04:00
multimethods.ss Chez Phase 1 (increment 3q): multimethod dispatch + late-bind 2026-06-18 01:24:01 -04:00
natives-coll.ss Chez Phase 2 (inc A): collection ctors + real map entries 2026-06-18 10:44:33 -04:00
natives-meta.ss Chez Phase 2 (inc L): var def-time metadata (jolt-zikh) 2026-06-18 17:13:46 -04:00
natives-misc.ss Chez Phase 2 (inc I+J): first-class vars + scalar natives 2026-06-18 15:44:10 -04:00
natives-num.ss Chez Phase 2 (inc C): bit ops + parse-long/parse-double 2026-06-18 11:20:56 -04:00
natives-seq.ss Chez Phase 1 (increment 3o): transducer arities 2026-06-17 23:51:06 -04:00
natives-xform.ss Chez Phase 2 (inc H): volatiles + sequence/transduce 2026-06-18 14:47:03 -04:00
ns.ss Chez Phase 2 (inc K): namespace value model (jolt-yxqm) 2026-06-18 16:49:35 -04:00
post-prelude.ss Chez Phase 2 (inc K): namespace value model (jolt-yxqm) 2026-06-18 16:49:35 -04:00
predicates.ss Chez Phase 2 (inc A): collection ctors + real map entries 2026-06-18 10:44:33 -04:00
printing.ss Chez Phase 2 (inc B): readable printer + output seams 2026-06-18 11:20:56 -04:00
records.ss Chez Phase 2 (inc D): records + protocols 2026-06-18 11:55:20 -04:00
regex.ss Chez Phase 1 (increment 3p): misc seq/regex gaps + bug tracking 2026-06-18 00:44:21 -04:00
rt.ss Chez Phase 2 (inc M): dynamic var binding (jolt-2o7x) 2026-06-18 18:29:55 -04:00
seq.ss Chez Phase 2 (inc G): lazy-seq bridge (make-lazy-seq / coll->cells) 2026-06-18 13:53:02 -04:00
transients.ss Chez Phase 1 (increment 3p): misc seq/regex gaps + bug tracking 2026-06-18 00:44:21 -04:00
values.ss Chez Phase 1 (increment 3b): seq tier + dynamic IFn dispatch on the Chez RT 2026-06-17 15:19:18 -04:00
vars.ss Chez Phase 2 (inc I+J): first-class vars + scalar natives 2026-06-18 15:44:10 -04:00