core: Stage 2 tier 6b — ns-introspection fns compile as ordinary invokes
create-ns/remove-ns/find-ns/all-ns/the-ns/ns-interns/ns-aliases/ns-imports/ ns-resolve/resolve/refer become ctx-capturing clojure.core fns (install-stateful-fns!) with evaluated-arg Clojure semantics, replacing interpreter special arms that were loose: the-ns/ns-interns/ns-aliases/ ns-imports ignored their argument (always current ns), create-ns/remove-ns/ ns-resolve took theirs unevaluated. The optional-arg forms still default to the current ns, preserving the prior 0-arg behavior. refer previously had a special-names entry but NO interpreter arm — it errored everywhere; it now refers the named ns's public vars (use-impl), :only/:exclude filters not yet honored. ns-resolve does its lookup directly: types/ns-resolve keys ns-find with the symbol struct instead of its name string and never finds anything. Removed all of them from the evaluator arms, host_iface special-names, and compiler uncompilable-heads (use/ns/require/in-ns stay punted in the bootstrap compiler — it builds analyzer.clj, whose ns forms need the interpreter). Gate: conformance 285x3 (+8 ns-fn cases), fallback-zero 62/3, fixpoint, self-host, sci, staged, suite 4049>=4034 (+2 passes), all specs+unit.
This commit is contained in:
parent
d18ca7abad
commit
b11a072ea3
5 changed files with 84 additions and 27 deletions
|
|
@ -57,7 +57,14 @@
|
|||
"(var-get (var map))" "(var? (var map))" "(var-set (var map) map)"
|
||||
"(alter-var-root (var map) identity)" "(find-var (quote clojure.core/map))"
|
||||
"(intern (quote user) (quote tier6-sym) 42)"
|
||||
"(alter-meta! (var map) assoc :k 1)" "(reset-meta! (var map) {})"])
|
||||
"(alter-meta! (var map) assoc :k 1)" "(reset-meta! (var map) {})"
|
||||
# Stage 2 tier 6b: ns-introspection fns are ordinary invokes now
|
||||
"(find-ns (quote clojure.core))" "(create-ns (quote t6.created))"
|
||||
"(remove-ns (quote t6.created))" "(count (all-ns))"
|
||||
"(the-ns (quote clojure.core))" "(ns-interns (quote clojure.core))"
|
||||
"(ns-aliases (quote user))" "(ns-imports (quote user))"
|
||||
"(ns-resolve (quote clojure.core) (quote map))" "(resolve (quote map))"
|
||||
"(refer (quote clojure.string))"])
|
||||
|
||||
# --- Intentional fallback (sanity sample): these SHOULD punt to the interpreter.
|
||||
# The remaining frozen/uncompiled set keeps the harness honest in the punt
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue