summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-09-16 06:55:59 -0700
committerKaz Kylheku <kaz@kylheku.com>2016-09-16 06:55:59 -0700
commit6b40915a50db3159394221a7b6b46cbb74dae606 (patch)
treef3e84df93663617030daedd662ca7c7bc1546acb /txr.1
parent73f7e2e1c2352cc1da6784190468c24c6e003655 (diff)
downloadtxr-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.114
1 files changed, 13 insertions, 1 deletions
diff --git a/txr.1 b/txr.1
index e524dbce..1cbaff45 100644
--- a/txr.1
+++ b/txr.1
@@ -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