Phases 15-16: SCI bootstrap, Janet interop, eval, lazy-cat, CLJS ported tests

- SCI bootstrap complete: all 9 SCI source files load (317 forms, 0 failures)
- prefer-method/remove-method/remove-all-methods promoted to special forms
- eval special form (interpreter + compiler) with eval-test.janet
- lazy-cat macro with structural equality tests in lazy-test.janet
- Janet-native interop via . special form on tables/structs:
  field access (. obj :key), method calls (. obj method args...)
  fn* form compilation support, .- reader sugar
  interop-test.janet with 7 test sections (14 assertions)
- New core bindings: with-meta, var-dynamic?, load-string
- ^:dynamic def handler, core-str nil handling, core-meta for with-meta
- 7 new CLJS ported test files: cljs-port-6 through -10, cljs-core-test, cljs-collections-test
- test-sci-runtime.janet verifies SCI namespaces/types/Var/IBox/IVar
- 317/317 tests pass, 0 failing scripts, 440+ assertions across 31 test files
- README updated with Janet interop documentation
This commit is contained in:
Yogthos 2026-06-03 23:44:49 -04:00
parent 9ac8f26a70
commit 0e08f65016
42 changed files with 770 additions and 837 deletions

View file

@ -32,6 +32,22 @@
(++ i)))
(push-str buf "]"))
# LazySeq — realize and print as a list
(and (table? v) (= :jolt/lazy-seq (v :jolt/type)))
(do
(def val (if (get v :realized) (v :val) (let [vf ((v :fn))] (put v :realized true) (put v :val vf) vf)))
(if (nil? val)
(push-str buf "()")
(do
(push-str buf "(")
(var i 0)
(let [n (length val)]
(while (< i n)
(write-value (in val i) buf)
(when (< (+ i 1) n) (push-str buf " "))
(++ i)))
(push-str buf ")"))))
(array? v)
(do
(push-str buf "(")
@ -106,7 +122,7 @@
(push-str buf (string "#'" (ctx-current-ns ctx) "/" ((var-name v) :name)))
(or (tuple? v) (array? v) (struct? v) (table? v))
(write-collection v buf)
(push-str buf (string v)))))
true (push-str buf (string v)))))
(defn print-value [v]
(def buf @"")