diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2014-02-28 07:27:08 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2014-02-28 07:27:08 -0800 |
commit | 8083f2eec64fb7f202e31ffe050ff6aa40f5e5fd (patch) | |
tree | babf3ca3a48d4c077eaa11808b196d230c429603 | |
parent | a14b74d2d383ce2c8694976da078da52199c0b37 (diff) | |
download | txr-8083f2eec64fb7f202e31ffe050ff6aa40f5e5fd.tar.gz txr-8083f2eec64fb7f202e31ffe050ff6aa40f5e5fd.tar.bz2 txr-8083f2eec64fb7f202e31ffe050ff6aa40f5e5fd.zip |
* eval.c (expand_qquote): Fix broken '(,x . ,y) case, which
is generating (append (list x) . y) instead of (append (list x) y).
Also, added a nil case which is now necessary to prevent
'(,x) from generating (append (list x) nil), though this is
effectively an optimization, which is pointless, since
the expander isn't optimizing overall.
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | eval.c | 6 |
2 files changed, 13 insertions, 2 deletions
@@ -1,5 +1,14 @@ 2014-02-28 Kaz Kylheku <kaz@kylheku.com> + * eval.c (expand_qquote): Fix broken '(,x . ,y) case, which + is generating (append (list x) . y) instead of (append (list x) y). + Also, added a nil case which is now necessary to prevent + '(,x) from generating (append (list x) nil), though this is + effectively an optimization, which is pointless, since + the expander isn't optimizing overall. + +2014-02-28 Kaz Kylheku <kaz@kylheku.com> + * tests/010/output-clauses.expected: New file. * tests/010/output-clauses.txr: New file. @@ -2051,8 +2051,10 @@ static val expand_qquote(val qquoted_form, val menv) f_ex = cons(list_s, cons(expand_qquote(f, menv), nil)); } - if (atom(r_ex)) { - return rlcp(cons(append_s, cons(f_ex, r_ex)), qquoted_form); + if (nilp(r_ex)) { + return rlcp(cons(append_s, cons(f_ex, nil)), qquoted_form); + } else if (atom(r_ex)) { + return rlcp(cons(append_s, cons(f_ex, cons(r_ex, nil))), qquoted_form); } else { if (consp(r) && car(r) == unquote_s) r_ex = cons(r_ex, nil); |