diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2014-01-30 06:50:34 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2014-01-30 06:50:34 -0800 |
commit | 266f327291c92c3e26bfb2b9dccaa9136e7604b4 (patch) | |
tree | b92e891a7576618abaa70c0febe6c04b64e1b959 | |
parent | 5a2001e2172b6b65efa6d8d6e8dfa524ff796487 (diff) | |
download | txr-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-- | ChangeLog | 8 | ||||
-rw-r--r-- | eval.c | 2 |
2 files changed, 9 insertions, 1 deletions
@@ -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 @@ -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); |