diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2022-05-30 06:44:28 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2022-05-30 06:44:28 -0700 |
commit | cce3c4bef38888be015b0652d136e34c8ae7e59f (patch) | |
tree | 8f1af5da0718bf01b71ca860616ca7b8f3d652a6 /eval.c | |
parent | bc591cb5ee04582dbdf17a0125987ec03e8c064f (diff) | |
download | txr-cce3c4bef38888be015b0652d136e34c8ae7e59f.tar.gz txr-cce3c4bef38888be015b0652d136e34c8ae7e59f.tar.bz2 txr-cce3c4bef38888be015b0652d136e34c8ae7e59f.zip |
New: spln and tokn functions.
Instead of trying to work the new count parameter into the spl and
tok functions, it's better to make new ones.
* eval.c (eval_init): spln and tokn intrinsics registered.
* lib.[ch] (spln, tokn): New functions.
* tests/015/split.tl: New test cases.
* txr.1: Documented.
* stdlib/doc-syms.tl: Updated.
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -7215,10 +7215,12 @@ void eval_init(void) reg_fun(intern(lit("cat-str"), user_package), func_n2o(cat_str, 1)); reg_fun(intern(lit("split-str"), user_package), func_n4o(split_str_keep, 2)); reg_fun(intern(lit("spl"), user_package), func_n3o(spl, 2)); + reg_fun(intern(lit("spln"), user_package), func_n4o(spln, 3)); reg_fun(intern(lit("split-str-set"), user_package), func_n2(split_str_set)); reg_fun(intern(lit("sspl"), user_package), func_n2(sspl)); reg_fun(intern(lit("tok-str"), user_package), func_n4o(tok_str, 2)); reg_fun(intern(lit("tok"), user_package), func_n3o(tok, 2)); + reg_fun(intern(lit("tokn"), user_package), func_n4o(tokn, 3)); reg_fun(intern(lit("tok-where"), user_package), func_n2(tok_where)); reg_fun(intern(lit("list-str"), user_package), func_n1(list_str)); reg_fun(intern(lit("trim-str"), user_package), func_n1(trim_str)); |