Phase 14 fixes: pr-str mapping, every-pred, PLAN.md update
- compiler.janet: fix core-pr-str mapping — was pointing to core-str (line 221) - core.janet: add core-pr-str (string/format-based serialization with proper quoting), add core-every-pred (variadic predicate composition), wire both into core-bindings - cljs-port-5.janet: restore var-dynamic? test, with-meta preserves test, add pr-str keyword and every-pred assertions - PLAN.md: update to current state — all phases 0-14 checked off, 316/317 316 ok, 1 fail (pre-existing, unchanged)
This commit is contained in:
parent
6b0fdefc61
commit
84d92c1008
6 changed files with 136 additions and 37 deletions
|
|
@ -8,14 +8,15 @@
|
|||
(print " ok")
|
||||
(print "23: metadata...")
|
||||
(let [ctx (init)]
|
||||
(ct-eval ctx "(def ^:dynamic *dyn5* 42)")
|
||||
(assert (= true (ct-eval ctx "(var-dynamic? (var *dyn5*))")) "dynamic metadata")
|
||||
(ct-eval ctx "(def ^:dynamic *dyn* 42)")
|
||||
(assert (= true (ct-eval ctx "(var-dynamic? (var *dyn*))")) "dynamic metadata")
|
||||
(assert (= 1 (ct-eval ctx "(:a (with-meta {:a 1} {:c 3}))")) "with-meta preserves"))
|
||||
(print " ok")
|
||||
(print "24: function composition...")
|
||||
(let [ctx (init)]
|
||||
(assert (= true (ct-eval ctx "((complement odd?) 2)")) "complement")
|
||||
(assert (= 5 (ct-eval ctx "((constantly 5) :anything)")) "constantly")
|
||||
(assert (= true (ct-eval ctx "((every-pred number? even?) 4)")) "every-pred true"))
|
||||
(assert (= true (ct-eval ctx "((every-pred number? even?) 4)")) "every-pred")
|
||||
(assert (= ":hello" (ct-eval ctx "(pr-str :hello)")) "pr-str keyword"))
|
||||
(print " ok")
|
||||
(print "\nAll CLJS Ported Part 5 tests passed!")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue