summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog9
-rw-r--r--eval.c6
2 files changed, 13 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index cda2c3f1..e2b45169 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
diff --git a/eval.c b/eval.c
index a5b5aba5..bfc42f18 100644
--- a/eval.c
+++ b/eval.c
@@ -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);