diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2016-09-16 06:55:59 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2016-09-16 06:55:59 -0700 |
commit | 6b40915a50db3159394221a7b6b46cbb74dae606 (patch) | |
tree | f3e84df93663617030daedd662ca7c7bc1546acb /eval.c | |
parent | 73f7e2e1c2352cc1da6784190468c24c6e003655 (diff) | |
download | txr-6b40915a50db3159394221a7b6b46cbb74dae606.tar.gz txr-6b40915a50db3159394221a7b6b46cbb74dae606.tar.bz2 txr-6b40915a50db3159394221a7b6b46cbb74dae606.zip |
split-str gains ability to keep separating pieces.
* eval.c (eval_init): Register split-str to split_str_keep,
with optional argument.
* lib.c (split_str_keep): New function, formed from
split_str, with third argument.
(split_str): Reduced to wrapper around split_str_keep.
Thus we don't have to update umpteen existing calls
with an extra nil parameter.
* lib.h (split_str_keep): Declared.
* txr.1: Documented new optional argument of split-str.
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -5233,7 +5233,7 @@ void eval_init(void) reg_fun(intern(lit("sub-str"), user_package), func_n3o(sub_str, 1)); reg_fun(intern(lit("replace-str"), user_package), func_n4o(replace_str, 2)); reg_fun(intern(lit("cat-str"), user_package), func_n2o(cat_str, 1)); - reg_fun(intern(lit("split-str"), user_package), func_n2(split_str)); + reg_fun(intern(lit("split-str"), user_package), func_n3o(split_str_keep, 2)); reg_fun(intern(lit("split-str-set"), user_package), func_n2(split_str_set)); reg_fun(intern(lit("tok-str"), user_package), func_n3o(tok_str, 1)); reg_fun(intern(lit("tok-where"), user_package), func_n2(tok_where)); |