summaryrefslogtreecommitdiffstats
path: root/lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/lib.c b/lib.c
index 98e80315..22135f89 100644
--- a/lib.c
+++ b/lib.c
@@ -6668,6 +6668,28 @@ val vectorv(struct args *args)
return vec;
}
+val vec(val first, ...)
+{
+ va_list vl;
+ val vec = vector(zero, nil);
+ val next;
+ int count;
+
+ va_start (vl, first);
+
+ for (next = first, count = 0;
+ next != nao && count < 32;
+ next = va_arg(vl, val), count++)
+ {
+ vec_push(vec, next);
+ }
+
+ if (count == 32 && next != nao)
+ internal_error("runaway arguments in vec function");
+
+ return vec;
+}
+
val vec_list(val list)
{
val vec = vector(zero, nil);