Starting work on a partial evaluator - just sketching for now, needs a bunch of work and likely some foundational changes

This commit is contained in:
Nathan Braswell
2021-08-09 23:58:40 -04:00
parent d2215c2831
commit e1fa65deaf
2 changed files with 135 additions and 0 deletions

16
partial_eval_test.kp Normal file
View File

@@ -0,0 +1,16 @@
(with_import "./partial_eval.kp"
(let (
test-case (lambda (code) (let (
_ (println "Code: " code)
partially_evaled (partial_eval code)
_ (println "Partially evaled: " partially_evaled)
fully_evaled (eval (val partially_evaled))
_ (println "Fully evaled: " fully_evaled)
_ (println)
) fully_evaled))
simple_add (read-string "(+ 1 2)")
vau_with_add (read-string "(vau de (x) (+ (eval x de) (+ 1 2)))")
_ (test-case simple_add)
_ (test-case vau_with_add)
) nil))