And lambda is working nicely too, once I added support for val to the function call evaluaator (just looking it up in comb_to_mark_map)
This commit is contained in:
@@ -114,6 +114,8 @@
|
|||||||
_ (println (indent_str indent) "Going to do an array call!")
|
_ (println (indent_str indent) "Going to do an array call!")
|
||||||
_ (println (indent_str indent) " total is " x)
|
_ (println (indent_str indent) " total is " x)
|
||||||
_ (println (indent_str indent) " evaled comb is " comb)
|
_ (println (indent_str indent) " evaled comb is " comb)
|
||||||
|
comb (if (val? comb) (get-value comb_to_mark_map (.val comb))
|
||||||
|
comb)
|
||||||
)
|
)
|
||||||
; it seems like even if it's later we should be able to eval some?
|
; it seems like even if it's later we should be able to eval some?
|
||||||
; Maybe there should be something between 'later and 'comb made in vau
|
; Maybe there should be something between 'later and 'comb made in vau
|
||||||
@@ -175,7 +177,7 @@
|
|||||||
[comb_to_mark_map ['later (cons actual_function literal_params)]])
|
[comb_to_mark_map ['later (cons actual_function literal_params)]])
|
||||||
[comb_to_mark_map func_result])
|
[comb_to_mark_map func_result])
|
||||||
) result)
|
) result)
|
||||||
true (error (str "Partial eval noticed that you will likely call not a function " x))))
|
true (error (str "Partial eval noticed that you will likely call not a function " comb " total is " x))))
|
||||||
(nil? x) [comb_to_mark_map ['val x]]
|
(nil? x) [comb_to_mark_map ['val x]]
|
||||||
true (error (str "impossible partial_eval value " x))
|
true (error (str "impossible partial_eval value " x))
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -56,7 +56,25 @@
|
|||||||
let2_test (read-string "((wrap (vau (let1) (let1 a 12 (vau (x) (+ a 1))))) (vau de (s v b) (eval (array (array vau (array s) b) (eval v de)) de)))")
|
let2_test (read-string "((wrap (vau (let1) (let1 a 12 (vau (x) (+ a 1))))) (vau de (s v b) (eval (array (array vau (array s) b) (eval v de)) de)))")
|
||||||
let3_test (read-string "((wrap (vau (let1) (let1 a 12 (wrap (vau (x) (+ x a 1)))))) (vau de (s v b) (eval (array (array vau (array s) b) (eval v de)) de)))")
|
let3_test (read-string "((wrap (vau (let1) (let1 a 12 (wrap (vau (x) (+ x a 1)))))) (vau de (s v b) (eval (array (array vau (array s) b) (eval v de)) de)))")
|
||||||
let4_test (read-string "((wrap (vau (let1) (let1 a 12 (wrap (vau (x) (let1 y (+ a 1) (+ y x a))))))) (vau de (s v b) (eval (array (array vau (array s) b) (eval v de)) de)))")
|
let4_test (read-string "((wrap (vau (let1) (let1 a 12 (wrap (vau (x) (let1 y (+ a 1) (+ y x a))))))) (vau de (s v b) (eval (array (array vau (array s) b) (eval v de)) de)))")
|
||||||
;let5_test (read-string "((wrap (vau (let1) (let1 a 12 (wrap (vau (x) (let1 y (+ x a 1) (+ y x a))))))) (vau de (s v b) (eval (array (array vau (array s) b) (eval v de)) de)))")
|
let5_test (read-string "((wrap (vau (let1) (let1 a 12 (wrap (vau (x) (let1 y (+ x a 1) (+ y x a))))))) (vau de (s v b) (eval (array (array vau (array s) b) (eval v de)) de)))")
|
||||||
|
|
||||||
|
lambda1_test (read-string "((wrap (vau (let1)
|
||||||
|
(let1 lambda (vau se (p b) (wrap (eval (array vau p b) se)))
|
||||||
|
(lambda (x) x)
|
||||||
|
))) (vau de (s v b) (eval (array (array vau (array s) b) (eval v de)) de)))")
|
||||||
|
lambda2_test (read-string "((wrap (vau (let1)
|
||||||
|
(let1 lambda (vau se (p b) (wrap (eval (array vau p b) se)))
|
||||||
|
(let1 a 12
|
||||||
|
(lambda (x) (+ a x)))
|
||||||
|
))) (vau de (s v b) (eval (array (array vau (array s) b) (eval v de)) de)))")
|
||||||
|
lambda3_test (read-string "((wrap (vau (let1)
|
||||||
|
(let1 lambda (vau se (p b) (wrap (eval (array vau p b) se)))
|
||||||
|
(let1 a 12
|
||||||
|
(lambda (x) (let1 b (+ a x)
|
||||||
|
(+ a x b))))
|
||||||
|
))) (vau de (s v b) (eval (array (array vau (array s) b) (eval v de)) de)))")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;big_test1 [[vau ['*ARGV*] (read-string (slurp "./prelude.kp"))] ["" "-C" "1339"]]
|
;big_test1 [[vau ['*ARGV*] (read-string (slurp "./prelude.kp"))] ["" "-C" "1339"]]
|
||||||
;big_test1 [[vau ['*ARGV*] (read-string (slurp "./prelude.kp"))] ["" "-C" "(let (a 17) (vau (x) a))"]]
|
;big_test1 [[vau ['*ARGV*] (read-string (slurp "./prelude.kp"))] ["" "-C" "(let (a 17) (vau (x) a))"]]
|
||||||
@@ -70,8 +88,6 @@
|
|||||||
_ (test-case vau_with_no_eval_add)
|
_ (test-case vau_with_no_eval_add)
|
||||||
_ (test-case vau_with_wrap_add)
|
_ (test-case vau_with_wrap_add)
|
||||||
_ (test-case vau_with_add_p)
|
_ (test-case vau_with_add_p)
|
||||||
;; No longer works with our more aggressive partial-evaling of vaus with incomplete environments
|
|
||||||
;; BUT DOES CUZ I ROLLED THAT BACK
|
|
||||||
_ (test-case vau_with_add_p_called)
|
_ (test-case vau_with_add_p_called)
|
||||||
_ (test-case cond_test)
|
_ (test-case cond_test)
|
||||||
_ (test-case cond_vau_test)
|
_ (test-case cond_vau_test)
|
||||||
@@ -88,7 +104,11 @@
|
|||||||
_ (test-case let2_test)
|
_ (test-case let2_test)
|
||||||
_ (test-case let3_test)
|
_ (test-case let3_test)
|
||||||
_ (test-case let4_test)
|
_ (test-case let4_test)
|
||||||
;_ (test-case let5_test)
|
_ (test-case let5_test)
|
||||||
|
|
||||||
|
_ (test-case lambda1_test)
|
||||||
|
_ (test-case lambda2_test)
|
||||||
|
_ (test-case lambda3_test)
|
||||||
|
|
||||||
;_ (println "THE BIG SHOW")
|
;_ (println "THE BIG SHOW")
|
||||||
;_ (println big_test1)
|
;_ (println big_test1)
|
||||||
|
|||||||
Reference in New Issue
Block a user