Phase 1 complete: Var/Namespace system with binding macro fix
Root causes: - core-binding used tuples instead of arrays for call forms. Evaluator treats tuples as literal vectors, so calls failed. Fixed with @[...] and proper (push-thread-bindings frame) forms. - try handler: finally only ran on error, not success. Fixed to run finally on both paths. - ns accessors: all-ns, remove-ns, create-ns, the-ns, ns-interns, ns-aliases, ns-imports-fn added to types.janet - ns form: :require/:refer, :use, :refer-clojure/:exclude, :import - eval-require: :refer support - All 317 tests pass, 0 failures
This commit is contained in:
parent
496f169a2e
commit
c1dde767c8
3 changed files with 26 additions and 11 deletions
|
|
@ -250,3 +250,14 @@
|
|||
(print " passed")
|
||||
|
||||
(print "\nAll Phase 1 tests passed!")
|
||||
|
||||
(print "16: binding macro...")
|
||||
(let [ctx (init)]
|
||||
(eval-string ctx "(def ^:dynamic *x* 10)")
|
||||
(assert (= 10 (eval-string ctx "*x*")) "dynamic var default")
|
||||
(assert (= 99 (eval-string ctx "(binding [*x* 99] *x*)")) "binding rebinds")
|
||||
(assert (= 10 (eval-string ctx "*x*")) "binding restored"))
|
||||
|
||||
(print " passed")
|
||||
|
||||
(print "\nAll Phase 1 tests passed!")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue