summaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2020-06-28 08:48:20 -0700
committerKaz Kylheku <kaz@kylheku.com>2020-06-28 08:48:20 -0700
commitdbcfe10c3a9dc881e1f157582c01074fc60623f4 (patch)
tree20ea4d2c453e68104c625b67d63f24d79ca01610 /eval.c
parent0197d1dc1c43b808bfbe641ef702b10128fbdc9d (diff)
downloadtxr-dbcfe10c3a9dc881e1f157582c01074fc60623f4.tar.gz
txr-dbcfe10c3a9dc881e1f157582c01074fc60623f4.tar.bz2
txr-dbcfe10c3a9dc881e1f157582c01074fc60623f4.zip
New functions: list-seq, ved-seq and str-seq.
These functions convert any iterable to a list, vector or string. * eval.c (eval_init): Registered list-seq, vec-seq and str-seq intrinsics. * lib.c (list_seq, vec_seq, str_seq): New functions. * lib.h (list_seq, vec_seq, str_seq): Declared. * txr.1: Documented.
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/eval.c b/eval.c
index 405851f1..cd282da0 100644
--- a/eval.c
+++ b/eval.c
@@ -6926,6 +6926,9 @@ void eval_init(void)
reg_fun(intern(lit("uni"), user_package), func_n4o(uni, 2));
reg_fun(intern(lit("seqp"), user_package), func_n1(seqp));
+ reg_fun(intern(lit("list-seq"), user_package), func_n1(list_seq));
+ reg_fun(intern(lit("vec-seq"), user_package), func_n1(vec_seq));
+ reg_fun(intern(lit("str-seq"), user_package), func_n1(str_seq));
reg_fun(intern(lit("length"), user_package), length_f);
reg_fun(intern(lit("len"), user_package), length_f);
reg_fun(intern(lit("empty"), user_package), func_n1(empty));