From 848e5565a06fc206f159f6544fb8fba376381c30 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 3 Jun 2014 06:27:43 -0700 Subject: * 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. --- ChangeLog | 7 +++++++ eval.c | 15 +++++---------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3ff7b5bf..7f475e77 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2014-06-03 Kaz Kylheku + + * 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. + 2014-06-03 Kaz Kylheku Documenting the return value of rplaca and rplacd, and changing diff --git a/eval.c b/eval.c index bbd76c2d..1be989f2 100644 --- a/eval.c +++ b/eval.c @@ -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) -- cgit v1.2.3