jolt/host/chez
Yogthos 02139af0a1 Chez Phase 1 (increment 3q): multimethod dispatch + late-bind
host/chez/multimethods.ss implements the multimethod runtime: defmulti/defmethod
expand to defmulti-setup/defmethod-setup calls (+ get-method/methods/
remove-method/prefer-method/prefers). A jolt-multifn record carries its dispatch
fn and a jolt=-keyed method table; jolt-invoke dispatches it (exact match, then
isa?/hierarchy with prefer-method, then :default), reusing the overlay's
isa?/derive/make-hierarchy. The multifn's ns comes from a runtime chez-current-ns
(default user; the prelude load sets clojure.core for print-method/print-dup).

Two emit-side changes were needed:
- late-bind (:late-bind-unresolved? ctx flag, default OFF): defmulti expands to a
  bare-symbol setup call, so the analyzer doesn't intern the name and a forward
  reference '(area ...)' after '(defmulti area ...)' in one form was 'Unable to
  resolve symbol'. The strict compiler punts these to the interpreter; the Chez
  back end has none, so the flag lowers an unresolved symbol to a var-ref against
  the compile ns (open-world -e semantics). Set only by the Chez make-ctx /
  jolt-chez; the main compiler keeps strict resolution (host_iface late-bind?
  defaults nil).
- a :var call head now routes through jolt-invoke, since a late-bound var can hold
  a multifn (or keyword/coll IFn), not just a procedure. Transparent for
  procedures; the hot self-recursive call is a :local known-proc, stays direct.

Class-based dispatch ((class x)/String) deferred (needs deftype/class subsystem).

Parity 1506 -> 1530/2497, 0 new divergences. emit-test 302/302. Full janet gate
green (the analyzer flag is off there; suite flakiness under parallel load only).
2026-06-18 01:24:01 -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 1 (increment 3p): misc seq/regex gaps + bug tracking 2026-06-18 00:44:21 -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 1 (increment 3q): multimethod dispatch + late-bind 2026-06-18 01:24:01 -04:00
emit.janet Chez Phase 1 (increment 3q): multimethod dispatch + late-bind 2026-06-18 01:24:01 -04:00
jolt-chez.janet Chez Phase 1 (increment 3q): multimethod dispatch + late-bind 2026-06-18 01:24:01 -04:00
multimethods.ss Chez Phase 1 (increment 3q): multimethod dispatch + late-bind 2026-06-18 01:24:01 -04:00
natives-seq.ss Chez Phase 1 (increment 3o): transducer arities 2026-06-17 23:51:06 -04:00
post-prelude.ss Chez Phase 1 (increment 3j): assemble the clojure.core prelude, -e-capable jolt-chez 2026-06-17 20:50:42 -04:00
predicates.ss Chez Phase 1 (increment 3j): assemble the clojure.core prelude, -e-capable jolt-chez 2026-06-17 20:50:42 -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 1 (increment 3q): multimethod dispatch + late-bind 2026-06-18 01:24:01 -04:00
seq.ss Chez Phase 1 (increment 3n): seq-native shims + reduced 2026-06-17 23:16:26 -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