summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--lib.c3
2 files changed, 8 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index d921e543..9817d03a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2009-11-20 Kaz Kylheku <kkylheku@gmail.com>
+ * lib.c (flatten): Semantics change. The flatten function
+ should not map nil -> (nil), but nil -> nil.
+
+2009-11-20 Kaz Kylheku <kkylheku@gmail.com>
+
Changing ``obj_t *'' occurences to a ``val'' typedef. (Ideally,
we wouldn't have to declare object variables at all, so why
use an obtuse syntax to do so?)
diff --git a/lib.c b/lib.c
index e82311b1..11fd488a 100644
--- a/lib.c
+++ b/lib.c
@@ -397,6 +397,9 @@ val none_satisfy(val list, val pred, val key)
val flatten(val list)
{
+ if (list == nil)
+ return nil;
+
if (atom(list))
return cons(list, nil);