summaryrefslogtreecommitdiffstats
path: root/lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib.c b/lib.c
index d490a2c1..d2fa0147 100644
--- a/lib.c
+++ b/lib.c
@@ -470,6 +470,23 @@ val to_seq(val seq)
}
}
+val tolist(val seq)
+{
+ switch (type(seq)) {
+ case VEC:
+ return list_vector(seq);
+ case STR:
+ case LIT:
+ case LSTR:
+ return list_str(seq);
+ case NIL:
+ case CONS:
+ case LCONS:
+ default:
+ return seq;
+ }
+}
+
val *list_collect(val *ptail, val obj)
{
switch (type(*ptail)) {