core: Stage 2 tier 6a — var fns compile as ordinary invokes

var-get/var-set/var?/alter-var-root/alter-meta!/reset-meta! already had plain
core-bindings wrappers — the interpreter special arms shadowed them (and the
arm's alter-var-root silently dropped rest args, which the core wrapper
handles). find-var/intern need the ctx, so they join install-stateful-fns! as
ctx-capturing clojure.core fns; the old core-intern binding was a do-nothing
stub. Removed the eight from the evaluator special arms + special-symbol?,
host_iface special-names, and compiler uncompilable-heads.

Gate: conformance 277x3 (+6 var-fn cases incl. alter-var-root rest args),
fallback-zero 51/3, fixpoint, self-host, sci, staged, suite 4047>=4034 (one
new pass), all specs+unit.
This commit is contained in:
Yogthos 2026-06-10 09:29:53 -04:00
parent 2a3a5f3289
commit d002627d8e
6 changed files with 40 additions and 30 deletions

View file

@ -52,7 +52,12 @@
"(reify P (m [this] 1))" "(var map)"
# Stage 2 tier 5: type/dispatch definitional forms compile too
"(deftype Pt [x y])" "(deftype Sq [s] P (m [this] s))"
"(defrecord Rec [a b])" "(defmulti mf :k)" "(defmethod mf :a [x] x)"])
"(defrecord Rec [a b])" "(defmulti mf :k)" "(defmethod mf :a [x] x)"
# Stage 2 tier 6: var fns are ordinary invokes now
"(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) {})"])
# --- Intentional fallback (sanity sample): these SHOULD punt to the interpreter.
# The remaining frozen/uncompiled set keeps the harness honest in the punt