diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2014-02-02 02:37:17 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2014-02-02 02:37:17 -0800 |
commit | 256ba9369ab15b1eced9aa81fd1e466e138e2933 (patch) | |
tree | c579e25cf5e1cd302755c486c66f742eef853099 /lib.c | |
parent | 97b07f495505f5e3b9b0e99e8d024d85eedf0952 (diff) | |
download | txr-256ba9369ab15b1eced9aa81fd1e466e138e2933.tar.gz txr-256ba9369ab15b1eced9aa81fd1e466e138e2933.tar.bz2 txr-256ba9369ab15b1eced9aa81fd1e466e138e2933.zip |
* 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.
Diffstat (limited to 'lib.c')
-rw-r--r-- | lib.c | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -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)) { |