diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2009-11-20 14:23:59 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2009-11-20 14:23:59 -0800 |
commit | 5ceb99701389a4a935165245e1dd0e7b8aaf6e40 (patch) | |
tree | 103125078853eb1baedf372371a2b47d92c3d281 | |
parent | aaed1aa81d33693a28d6bd49117e4130b00bfa56 (diff) | |
download | txr-5ceb99701389a4a935165245e1dd0e7b8aaf6e40.tar.gz txr-5ceb99701389a4a935165245e1dd0e7b8aaf6e40.tar.bz2 txr-5ceb99701389a4a935165245e1dd0e7b8aaf6e40.zip |
* lib.c (flatten): Semantics change. The flatten function
should not map nil -> (nil), but nil -> nil.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | lib.c | 3 |
2 files changed, 8 insertions, 0 deletions
@@ -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?) @@ -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); |