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 /txr.1 | |
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 'txr.1')
-rw-r--r-- | txr.1 | 22 |
1 files changed, 21 insertions, 1 deletions
@@ -25486,9 +25486,10 @@ is zero, then returns a list of one element, which is .metn string . -.coNP Function @ spl +.coNP Functions @ spl and @ spln .synb .mets (spl < sep <> [ keep-between ] << string ) +.mets (spln < count < sep <> [ keep-between ] << string ) .syne .desc The @@ -25520,6 +25521,15 @@ family, in the common situation when .meta string is the unbound argument. +The +.code spln +function is similar to +.codn spl , +taking a required argument +.metn count , +which behaves exactly like the same-named argument of +.codn spl-str . + .coNP Functions @ split-str-set and @ sspl .synb .mets (split-str-set < string << set ) @@ -25672,6 +25682,7 @@ parameter. .coNP Function @ tok .synb .mets (tok < regex <> [ keep-between ] << string ) +.mets (tokn < count < regex <> [ keep-between ] << string ) .syne .desc The @@ -25703,6 +25714,15 @@ family, in the common situation when .meta string is the unbound argument. +The +.code tokn +function is similar to +.codn tok , +taking a required argument +.metn count , +which behaves exactly like the same-named argument of +.codn tok-str . + .coNP Function @ list-str .synb .mets (list-str << string ) |