summaryrefslogtreecommitdiffstats
path: root/lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib.c b/lib.c
index 913d2b47..d4cc50cc 100644
--- a/lib.c
+++ b/lib.c
@@ -888,11 +888,15 @@ static val lazy_appendv_func(val env, val lcons)
rplaca(lcons, last);
- if (atom(nonempty)) {
+ if (nilp(lists)) {
rplacd(lcons, nonempty);
return nil;
}
+ if (atom(nonempty))
+ uw_throwf(error_s, lit("append*: cannot append to atom ~s"),
+ nonempty, nao);
+
rplacd(env, lists);
{
@@ -914,9 +918,13 @@ val lazy_appendv(val lists)
break;
}
- if (atom(nonempty))
+ if (nilp(lists))
return nonempty;
+ if (atom(nonempty))
+ uw_throwf(error_s, lit("append*: cannot append to atom ~s"),
+ nonempty, nao);
+
{
loc ptail = ltail(mkcloc(nonempty));
set(ptail, make_lazy_cons(func_f1(cons(car(deref(ptail)), lists),