From 3fba129958c4287490f324538548d3db8077c5ee Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sat, 10 Dec 2022 23:44:31 -0800 Subject: doc: improve span-str, compl-span-str, break-str * txr.1: document return value better for span-str and compl-span-str. Add examples for all three functions. --- txr.1 | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'txr.1') diff --git a/txr.1 b/txr.1 index 43788954..0fdc5749 100644 --- a/txr.1 +++ b/txr.1 @@ -26658,6 +26658,18 @@ consists only of the characters in string .metn set , in any combination. +If both arguments are strings, the function returns +an integer between 0 and the length of +.metn str . + +.TP* Examples: +.verb + (span-str "abcde" "ab") -> 2 + (span-str "abcde" "z") -> 0 + (span-str "abcde" "") -> 0 + (span-str "abcde" "edcba") -> 5 +.brev + .coNP Function @ compl-span-str .synb .mets (compl-span-str < str << set ) @@ -26672,6 +26684,19 @@ consists only of the characters which do not appear in .metn set , in any combination. +If both arguments are strings, the function returns +an integer between 0 and the length of +.metn str . + +.TP* Examples: +.verb + (compl-span-str "abc,def" ",") -> 3 + (compl-span-str "abc," ",") -> 3 + (compl-span-str "abc" ",") -> 3 + (compl-span-str "abc3" "0123456789") -> 3 + (compl-span-str "3" "0123456789") -> 0 +.brev + .coNP Function @ break-str .synb .mets (break-str < str << set ) @@ -26689,6 +26714,13 @@ If there is no such character, then .code nil is returned. +.TP* Examples: +.verb + (break-str "abc,def.ghi" ",.:") -> 3 + (break-str "abc,def.ghi" ".:") -> 6 + (break-str "abc,def.ghi" ":") -> nil +.brev + .SS* Lazy Strings Lazy strings are objects that were developed for the \*(TX pattern-matching language, and are exposed via \*(TL. Lazy strings behave much like strings, -- cgit v1.2.3