feat: stub SCI host modules, fix require :as+:refer, +promoting ops/eduction
Push SCI loading much further: the giant clojure.core aggregation map in namespaces.cljc now resolves ALL its symbols (it previously failed on dozens). - host_stubs.clj: forward-decl no-op fns for SCI's host-layer modules (parser/read/load/macroexpand/resolve/proxy/reify) — Jolt supplies its own reader/loader, so these only need to resolve when the binding map is built. Stubs are non-nil fns so :refer re-interns them (a nil-valued var is dropped). - Load Jolt's clojure.string/set/walk/edn before namespaces.cljc. - Add real clojure.core: ==, print-str, eduction/->Eduction, seq-to-map-for-destructuring, split-lines, postwalk-demo/prewalk-demo, +'/-'/*'/inc'/dec' (Jolt doesn't overflow, so == non-quoted), proxy-super and friends (resolve-only, JVM-specific). Fix a real require bug: eval-require stopped at the first option, so [ns :as x :refer [...]] silently dropped the :refer. Now processes all options. SCI load: clojure.core map now builds; only two forms remain (a Var-protocol method on sci.lang.Var, and the clojure.repl namespace). conformance 218/218, features 78/78, jank 120.
This commit is contained in:
parent
dd51322ff1
commit
e52c445113
6 changed files with 125 additions and 10 deletions
|
|
@ -17,6 +17,16 @@
|
|||
[f form]
|
||||
(walk (partial prewalk f) identity (f form)))
|
||||
|
||||
(defn postwalk-demo
|
||||
"Demonstrates the behavior of postwalk by printing each form as it is walked."
|
||||
[form]
|
||||
(postwalk (fn [x] (print "Walked: ") (prn x) x) form))
|
||||
|
||||
(defn prewalk-demo
|
||||
"Demonstrates the behavior of prewalk by printing each form as it is walked."
|
||||
[form]
|
||||
(prewalk (fn [x] (print "Walked: ") (prn x) x) form))
|
||||
|
||||
(defn postwalk-replace
|
||||
[smap form]
|
||||
(postwalk (fn [x] (if (contains? smap x) (get smap x) x)) form))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue