Bugfix and improvment, eval one works even though eval isn't implemented yet!
This commit is contained in:
@@ -849,7 +849,7 @@ fun main(argc: int, argv: **char): int {
|
|||||||
var dynamic_env_name = str()
|
var dynamic_env_name = str()
|
||||||
if uses_dynamic_env {
|
if uses_dynamic_env {
|
||||||
if !params[0].is_symbol() {
|
if !params[0].is_symbol() {
|
||||||
return make_pair(null<KPEnv>(), KPResult::Err(kpString(str("first param to vau is not symbol"))))
|
return make_pair(null<KPEnv>(), KPResult::Err(kpString(str("first param to vau is not symbol ") + pr_str(params[0], true))))
|
||||||
}
|
}
|
||||||
dynamic_env_name = params[0].get_symbol_text()
|
dynamic_env_name = params[0].get_symbol_text()
|
||||||
offset = 1
|
offset = 1
|
||||||
|
|||||||
@@ -121,7 +121,7 @@
|
|||||||
) [comb_to_mark_map (cons evaled evaleds)])) [comb_to_mark_map []] params)
|
) [comb_to_mark_map (cons evaled evaleds)])) [comb_to_mark_map []] params)
|
||||||
)
|
)
|
||||||
(if (foldl (lambda (a x) (and a (val? x))) true evaled_params) [comb_to_mark_map ['val (lapply actual_function (map .val evaled_params))]]
|
(if (foldl (lambda (a x) (and a (val? x))) true evaled_params) [comb_to_mark_map ['val (lapply actual_function (map .val evaled_params))]]
|
||||||
[comb_to_mark_map ['later (cons actual_function params)]])))
|
[comb_to_mark_map ['later (cons actual_function (map strip evaled_params))]])))
|
||||||
) [f_sym ['prim_comb handler actual_function]]))
|
) [f_sym ['prim_comb handler actual_function]]))
|
||||||
give_up (vau de (f_sym) (let (
|
give_up (vau de (f_sym) (let (
|
||||||
actual_function (eval f_sym de)
|
actual_function (eval f_sym de)
|
||||||
@@ -150,7 +150,7 @@
|
|||||||
;(give_up vau)
|
;(give_up vau)
|
||||||
['vau ['prim_comb (lambda (de comb_to_mark_map params) (let (
|
['vau ['prim_comb (lambda (de comb_to_mark_map params) (let (
|
||||||
de? (if (= 3 (len params)) (idx params 0))
|
de? (if (= 3 (len params)) (idx params 0))
|
||||||
vau_de? (if (= nil de?) [] [de])
|
vau_de? (if (= nil de?) [] [de?])
|
||||||
vau_params (if (= nil de?) (idx params 0) (idx params 1))
|
vau_params (if (= nil de?) (idx params 0) (idx params 1))
|
||||||
body (if (= nil de?) (idx params 1) (idx params 2))
|
body (if (= nil de?) (idx params 1) (idx params 2))
|
||||||
inner_env ['env (concat (map (lambda (p) [p ['later p]]) vau_params) (if (= nil de?) [] [ [de? ['later de?]] ]) [de]) nil]
|
inner_env ['env (concat (map (lambda (p) [p ['later p]]) vau_params) (if (= nil de?) [] [ [de? ['later de?]] ]) [de]) nil]
|
||||||
|
|||||||
@@ -26,6 +26,6 @@
|
|||||||
_ (test-case vau_with_passthrough)
|
_ (test-case vau_with_passthrough)
|
||||||
_ (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)
|
||||||
;_ (test-case vau_with_add_p_called)
|
;_ (test-case vau_with_add_p_called)
|
||||||
) nil))
|
) nil))
|
||||||
|
|||||||
Reference in New Issue
Block a user