summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2014-01-30 06:50:34 -0800
committerKaz Kylheku <kaz@kylheku.com>2014-01-30 06:50:34 -0800
commit266f327291c92c3e26bfb2b9dccaa9136e7604b4 (patch)
treeb92e891a7576618abaa70c0febe6c04b64e1b959
parent5a2001e2172b6b65efa6d8d6e8dfa524ff796487 (diff)
downloadtxr-266f327291c92c3e26bfb2b9dccaa9136e7604b4.tar.gz
txr-266f327291c92c3e26bfb2b9dccaa9136e7604b4.tar.bz2
txr-266f327291c92c3e26bfb2b9dccaa9136e7604b4.zip
* 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.
-rw-r--r--ChangeLog8
-rw-r--r--eval.c2
2 files changed, 9 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index badd5347..414918aa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2014-01-30 Kaz Kylheku <kaz@kylheku.com>
+
+ * 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 <kaz@kylheku.com>
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);