From 256ba9369ab15b1eced9aa81fd1e466e138e2933 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sun, 2 Feb 2014 02:37:17 -0800 Subject: * eval.c (apply): Support string and vector arglist. (do_eval_args): Support string or vector in dot position. * lib.c (tolist): New function. * lib.h (tolist): Declared. * txr.1: Document how apply and dot position in compound forms supports strings as well as vectors. --- lib.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'lib.c') 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)) { -- cgit v1.2.3