From 5ceb99701389a4a935165245e1dd0e7b8aaf6e40 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 20 Nov 2009 14:23:59 -0800 Subject: * lib.c (flatten): Semantics change. The flatten function should not map nil -> (nil), but nil -> nil. --- ChangeLog | 5 +++++ lib.c | 3 +++ 2 files changed, 8 insertions(+) diff --git a/ChangeLog b/ChangeLog index d921e543..9817d03a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-11-20 Kaz Kylheku + + * lib.c (flatten): Semantics change. The flatten function + should not map nil -> (nil), but nil -> nil. + 2009-11-20 Kaz Kylheku Changing ``obj_t *'' occurences to a ``val'' typedef. (Ideally, 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); -- cgit v1.2.3