diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2014-06-03 06:27:43 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2014-06-03 06:27:43 -0700 |
commit | 848e5565a06fc206f159f6544fb8fba376381c30 (patch) | |
tree | 5f838436bd24b06f4be3fd6d47f076b3b7674171 /eval.c | |
parent | c66aa75d955df8eae0b5553a5a57601245ad65af (diff) | |
download | txr-848e5565a06fc206f159f6544fb8fba376381c30.tar.gz txr-848e5565a06fc206f159f6544fb8fba376381c30.tar.bz2 txr-848e5565a06fc206f159f6544fb8fba376381c30.zip |
* eval.c (eval_lisp1): Function removed.
(op_dwim, dwim_locs): Removing silly logic of separately calling
eval_lisp1 on the functor, and eval_lisp1_args on its arguments, since
lisp1 evaluation treats all position the same way.
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 15 |
1 files changed, 5 insertions, 10 deletions
@@ -930,11 +930,6 @@ val eval(val form, val env, val ctx_form) return do_eval(form, env, ctx_form, &lookup_var); } -static val eval_lisp1(val form, val env, val ctx_form) -{ - return do_eval(form, env, ctx_form, &lookup_sym_lisp1); -} - static val eval_args_lisp1(val form, val env, val ctx_form) { return do_eval_args(form, env, ctx_form, &lookup_sym_lisp1); @@ -1458,8 +1453,9 @@ static val op_modplace(val form, val env); static loc dwim_loc(val form, val env, val op, val newform, val *retval) { - val obj = eval_lisp1(second(form), env, form); - val args = eval_args_lisp1(rest(rest(form)), env, form); + val evargs = eval_args_lisp1(rest(form), env, form); + val obj = first(evargs); + val args = rest(evargs); switch (type(obj)) { case LIT: @@ -1816,9 +1812,8 @@ static val op_return_from(val form, val env) static val op_dwim(val form, val env) { - val obj = eval_lisp1(second(form), env, form); - val args = eval_args_lisp1(rest(rest(form)), env, form); - return apply(obj, args, form); + val args = eval_args_lisp1(cdr(form), env, form); + return apply(car(args), cdr(args), form); } static val op_catch(val form, val env) |