diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2014-02-24 02:14:27 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2014-02-24 02:14:27 -0800 |
commit | 74dbd0dc965618dd574a74368439c5804d198346 (patch) | |
tree | 8b04c9c2b0ffc54d6e8803b82dc5a46af527b33e /eval.c | |
parent | 8e8e14991164f2ddd33cac040a68b155847fa724 (diff) | |
download | txr-74dbd0dc965618dd574a74368439c5804d198346.tar.gz txr-74dbd0dc965618dd574a74368439c5804d198346.tar.bz2 txr-74dbd0dc965618dd574a74368439c5804d198346.zip |
* eval.c (expand_qquote): Bugfix. Was not handling an unquote
in the dotted position: (qquote x1 .. xn . (unquote form)),
which looks like the structure (qquote x1 .. xn unquote form).
Fixed by a hack: after recursively expanding the (unquote form)
part (rest of the form), we check whether the unexpanded
version has unquote at the front. If so, we know the expansion is just
form, and use it to emit the suitable expansion.
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -2065,7 +2065,9 @@ static val expand_qquote(val qquoted_form, val menv) if (atom(r_ex)) { return rlcp(cons(append_s, cons(f_ex, r_ex)), qquoted_form); } else { - if (car(r_ex) == append_s) + if (consp(r) && car(r) == unquote_s) + r_ex = cons(r_ex, nil); + else if (car(r_ex) == append_s) r_ex = cdr(r_ex); return rlcp(cons(append_s, cons(f_ex, r_ex)), qquoted_form); } |