bootstrap: SCI core deps loading with 284/304 forms passing
reader: #?@ empty splice fix (nil→@[]), #? nil→:jolt/skip, map reader handles #_/#?@ in K/V evaluator: unwrap-meta-name helper, deftype interns ->Name too, dot-suffix fix core: comment/prefer-method stubs, *unchecked-math*/*clojure-version* dynamic vars
This commit is contained in:
parent
cdcf569506
commit
b20536d1e3
31 changed files with 1348 additions and 65 deletions
42
test-eval.janet
Normal file
42
test-eval.janet
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
(use ./src/jolt/evaluator)
|
||||
(use ./src/jolt/types)
|
||||
(use ./src/jolt/reader)
|
||||
(use ./src/jolt/api)
|
||||
|
||||
(def ctx (init))
|
||||
|
||||
(defn load-all []
|
||||
(each fp ["/Users/yogthos/src/sci/src/sci/impl/macros.cljc"
|
||||
"/Users/yogthos/src/sci/src/sci/impl/protocols.cljc"
|
||||
"/Users/yogthos/src/sci/src/sci/impl/utils.cljc"
|
||||
"/Users/yogthos/src/sci/src/sci/impl/types.cljc"
|
||||
"/Users/yogthos/src/sci/src/sci/impl/unrestrict.cljc"]
|
||||
(def src (slurp fp))
|
||||
(var s src)
|
||||
(while (> (length (string/trim s)) 0)
|
||||
(def [f r] (parse-next s)) (set s r)
|
||||
(if (not (nil? f)) (protect (eval-form ctx @{} f)))))
|
||||
(def vs (slurp "/Users/yogthos/src/sci/src/sci/impl/vars.cljc"))
|
||||
(var s vs) (var c 0)
|
||||
(while (and (> (length (string/trim s)) 0) (< c 27))
|
||||
(def [f r] (parse-next s)) (set s r) (++ c)
|
||||
(if (not (nil? f)) (protect (eval-form ctx @{} f))))
|
||||
(each fp ["/Users/yogthos/src/sci/src/sci/lang.cljc"
|
||||
"/Users/yogthos/src/sci/src/sci/core.cljc"]
|
||||
(def src (slurp fp))
|
||||
(var s src)
|
||||
(while (> (length (string/trim s)) 0)
|
||||
(def [f r] (parse-next s)) (set s r)
|
||||
(if (not (nil? f)) (protect (eval-form ctx @{} f))))))
|
||||
|
||||
(load-all)
|
||||
|
||||
(print "=== Testing eval-string ===")
|
||||
|
||||
# Call sci.core/eval-string via our own eval
|
||||
(def src "(do (require (quote [sci.core :as sci])) (sci/eval-string (sci/init) (str (+ 1 2))))")
|
||||
(printf "eval: %s\n" src)
|
||||
(try
|
||||
(def result (eval-form ctx @{} (parse-string src)))
|
||||
(printf "result: %q\n" result)
|
||||
([err] (printf "FAIL: %q\n" err)))
|
||||
Loading…
Add table
Add a link
Reference in a new issue