diff options
-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); |