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 /txr.1 | |
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 'txr.1')
-rw-r--r-- | txr.1 | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -18436,7 +18436,7 @@ which is interposed between the catenated strings. .coNP Function @ split-str .synb -.mets (split-str < string << sep ) +.mets (split-str < string < sep <> [ keep-between ]) .syne .desc The @@ -18491,6 +18491,18 @@ This operation is nondestructive: .meta string is not modified in any way. +If the optional +.meta keep-between +argument is specified and is not +.codn nil , +If an argument is given and is true, then +.meta split-str +incorporates the matching separating pieces of +.meta string +into the resulting list, such that if the resulting +list is catenated, a string equivalent to the original +string will be produced. + Note: To split a string into pieces of length one such that an empty string produces .code nil |