summaryrefslogtreecommitdiffstats
path: root/lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib.c b/lib.c
index b912e9b0..6de77669 100644
--- a/lib.c
+++ b/lib.c
@@ -1512,6 +1512,15 @@ val lazy_flatten(val list)
}
}
+val flatcar(val tree)
+{
+ if (atom(tree))
+ return cons(tree, nil);
+ if (cdr(tree))
+ return nappend2(flatcar(car(tree)), flatcar(cdr(tree)));
+ return flatcar(car(tree));
+}
+
static val tuples_func(val env, val lcons)
{
list_collect_decl (out, ptail);