diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2022-08-17 07:07:41 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2022-08-17 07:07:41 -0700 |
commit | a2e0d566ef4d45d4915d43d035f6f21270d70178 (patch) | |
tree | 3e709fdf05798077b1eb3e97bc11ccab5bbe1f7f /stdlib | |
parent | ce231e5426cb9f2238158e46032215d5b410bd60 (diff) | |
download | txr-a2e0d566ef4d45d4915d43d035f6f21270d70178.tar.gz txr-a2e0d566ef4d45d4915d43d035f6f21270d70178.tar.bz2 txr-a2e0d566ef4d45d4915d43d035f6f21270d70178.zip |
New function: search-all
* eval.c (eval_init): search-all intrinsic registered.
* lib.c (search_common): New Boolean argument all,
indicating whether all positions are to be returned.
We must handle this in the two places where empty
key and sequence are handled, and also in the main loop.
A trick is used: the found variable is now bound by
list_collect_decl, but not used for collecting unless
all is true.
(search, rsearch, contains): Pass 0 for all argument
of search_common.
(search_all): New function.
* lib.h (search_all): Declared.
* tests/012/seq.tl: New tests.
* txr.1: Documented.
* stdlib/doc-syms.tl: Regenerated.
Diffstat (limited to 'stdlib')
-rw-r--r-- | stdlib/doc-syms.tl | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/stdlib/doc-syms.tl b/stdlib/doc-syms.tl index 98a4b668..5d056427 100644 --- a/stdlib/doc-syms.tl +++ b/stdlib/doc-syms.tl @@ -1679,6 +1679,7 @@ ("scan" "N-03E989D0") ("scan-until-match" "N-00EFD668") ("search" "N-015D8676") + ("search-all" "N-01F7174D") ("search-regex" "N-0250D465") ("search-regst" "N-0250D465") ("search-str" "N-0257180F") |