From 266f327291c92c3e26bfb2b9dccaa9136e7604b4 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Thu, 30 Jan 2014 06:50:34 -0800 Subject: * eval.c (expand_op): Fix broken do operator. In the case of the do operator, we must feed the entire form to the expander, not the individual forms. That is to say (do operator arg) must expand the form (operator arg), whereas (op fun arg) just expands the forms fun and arg individually. --- ChangeLog | 8 ++++++++ eval.c | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index badd5347..414918aa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2014-01-30 Kaz Kylheku + + * eval.c (expand_op): Fix broken do operator. In the case of the do + operator, we must feed the entire form to the expander, not the + individual forms. That is to say (do operator arg) must expand the + form (operator arg), whereas (op fun arg) just expands the forms fun + and arg individually. + 2014-01-29 Kaz Kylheku Version 77 diff --git a/eval.c b/eval.c index 142776fa..1d8c5ce4 100644 --- a/eval.c +++ b/eval.c @@ -1648,7 +1648,7 @@ static val supplement_op_syms(val ssyms, val max) static val expand_op(val sym, val body) { - val body_ex = expand_forms(body); + val body_ex = if3(sym == op_s, expand_forms(body), expand(body)); val rest_gensym = gensym(lit("rest-")); cons_bind (syms, body_trans, transform_op(body_ex, nil, rest_gensym)); val ssyms = sort(syms, func_n2(lt), car_f); -- cgit v1.2.3