Chez Phase 2 (inc K): namespace value model (jolt-yxqm)
Reimplement the ctx-coupled seed ns natives over the rt.ss var-table, since Chez has no ctx. host/chez/ns.ss adds a jns namespace value + a registry and binds find-ns/the-ns/create-ns/in-ns/all-ns/ns-publics/ns-map/ns-interns/ ns-aliases/resolve/find-var/ns-unmap/*ns* into clojure.core. The resolve friction: native-ops (+, map, …) are inlined at emit so they have no var-cell, and (resolve '+) was nil — diverging from Clojure where it's a var. Added a defined? flag to the var-cell record (set by def-var!/declare-var!, left false on a lazily-materialised forward ref) and def-var!'d every native-op name to its value-position proc, so resolve returns the cell iff genuinely defined. ns-unmap clears the flag. resolve never interns an empty cell (var-cell-lookup is non-creating). ns-name is overridden natively in post-prelude (the overlay reads (get ns :name), nil on a jns record); the printers render a namespace as its name. *ns* binds to the user ns; in-ns re-binds it. use/require cross-ns switching stays deferred to Phase 3 (the analyzer bakes a def's target ns at compile time). Prelude parity 1951 -> 1969, 0 new divergences; four now-passing allowlist entries dropped (ns *ns* cases + str-of-a-var). New focused gate test/chez/ _ns.janet (19 cases, expectations from the JVM-canonical build/jolt).
This commit is contained in:
parent
eb26ad0401
commit
32e2d8bd58
6 changed files with 247 additions and 10 deletions
|
|
@ -19,7 +19,8 @@
|
|||
(array/push parts (slurp (string "jolt-core/clojure/core/" tf ".clj"))))
|
||||
(each f ["host/chez/emit.janet" "host/chez/driver.janet" "host/chez/rt.ss"
|
||||
"host/chez/values.ss" "host/chez/collections.ss" "host/chez/seq.ss"
|
||||
"host/chez/atoms.ss" "host/chez/predicates.ss" "host/chez/regex.ss"]
|
||||
"host/chez/atoms.ss" "host/chez/predicates.ss" "host/chez/regex.ss"
|
||||
"host/chez/ns.ss" "host/chez/post-prelude.ss"]
|
||||
(array/push parts (slurp f)))
|
||||
(string/slice (string (hash (string/join parts))) 0))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue