diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2014-02-26 07:29:09 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2014-02-26 07:29:09 -0800 |
commit | 92ce6b7cf1cd8bd573ed1c796fff21a17e2ccd64 (patch) | |
tree | b44c9b592ef33117eecf7a06f97ef30454c79c7a | |
parent | 2a632dc3768f6c65abc8f33192cdcaef4c9a9571 (diff) | |
download | txr-92ce6b7cf1cd8bd573ed1c796fff21a17e2ccd64.tar.gz txr-92ce6b7cf1cd8bd573ed1c796fff21a17e2ccd64.tar.bz2 txr-92ce6b7cf1cd8bd573ed1c796fff21a17e2ccd64.zip |
* eval.c (do_eval): Set last_form_evaled just before
dispatching function, so it is not clobbered by argument evaluations.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | eval.c | 5 |
2 files changed, 8 insertions, 2 deletions
@@ -1,5 +1,10 @@ 2014-02-26 Kaz Kylheku <kaz@kylheku.com> + * eval.c (do_eval): Set last_form_evaled just before + dispatching function, so it is not clobbered by argument evaluations. + +2014-02-26 Kaz Kylheku <kaz@kylheku.com> + * eval.c (expand_op): Use rlcp_tree when constructing the dwim_body, since the append2 copies list structure. @@ -902,8 +902,6 @@ static val do_eval(val form, val env, val ctx_form, } else if (consp(form)) { val oper = car(form); - last_form_evaled = form; - if (regexp(oper)) debug_return (oper); @@ -912,15 +910,18 @@ static val do_eval(val form, val env, val ctx_form, if (entry) { opfun_t fp = (opfun_t) cptr_get(entry); + last_form_evaled = form; debug_return (fp(form, env)); } else { val fbinding = lookup_fun(env, oper); if (!fbinding) { + last_form_evaled = form; eval_error(form, lit("no such function or operator: ~s"), oper, nao); abort(); } else { val args = do_eval_args(rest(form), env, form, lookup); debug_frame(oper, args, nil, env, nil, nil, nil); + last_form_evaled = form; debug_return (apply(cdr(fbinding), args, form)); debug_end; } |