jolt/test/unit
Yogthos 3680ee6d58 core: Stage 2 Task 2 tier 5a — compile defmulti + defmethod
defmulti/defmethod become macros (30-macros) over ctx-capturing
clojure.core fns (defmulti-setup/defmethod-setup, interned by
install-stateful-fns!):
- defmulti: (defmulti name dispatch & opts) -> (defmulti-setup 'name
  dispatch ~@opts). name quoted; dispatch + opts (:default/:hierarchy)
  evaluated. defmulti-setup builds the dispatch closure over the method
  table and interns the var (same hierarchy/default/cache behavior).
- defmethod: (defmethod mm dval & fn-tail) -> (defmethod-setup 'mm dval
  (fn ~@fn-tail)). The method impl is now a COMPILED (fn …) (was an
  interpreted fn* eval). Auto-creates the multimethod if missing.
- removed their special-symbol? entries + eval-list arms, and dropped them
  from host_iface special-names + loader stateful-head?.

Both compile + interpret as plain invokes; dispatch incl. :default and
derive/hierarchy works in both modes.

Tests: evaluator-test (defmulti case) + namespace-test now use init (these
forms are overlay macros now, so a bare make-ctx lacks them).

Gate green: conformance 269x3, fallback-zero 38/4, bootstrap-fixpoint
stage1==2==3, self-host, staged-bootstrap, sci-bootstrap, clojure-test-suite
>=4034/67, features 78/78, all unit + spec (multimethods 16/16).
2026-06-09 16:47:45 -04:00
..
compiler-test.janet feat(compile): Phase 2 — native ops + direct calls (fib30 50s -> 0.076s, ~660x) 2026-06-05 18:00:46 -04:00
eval-test.janet test: restructure into unit / integration / spec layers + shared harness 2026-06-05 00:00:16 -04:00
evaluator-test.janet core: Stage 2 Task 2 tier 5a — compile defmulti + defmethod 2026-06-09 16:47:45 -04:00
interop-test.janet test: restructure into unit / integration / spec layers + shared harness 2026-06-05 00:00:16 -04:00
lazy-seq-test.janet test: restructure into unit / integration / spec layers + shared harness 2026-06-05 00:00:16 -04:00
macro-test.janet test: restructure into unit / integration / spec layers + shared harness 2026-06-05 00:00:16 -04:00
persistent-map-test.janet test: restructure into unit / integration / spec layers + shared harness 2026-06-05 00:00:16 -04:00
reader-test.janet support type hints; make metadata coherent 2026-06-06 00:36:10 -04:00
types-test.janet Compiler research (#10) 2026-06-09 07:30:25 +08:00