From c5cb755b237d8d96141569b9838428575b0d4992 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Mon, 20 May 2013 08:07:52 -0700 Subject: * txr.1: Misleading documentation updated for split-str, which takes a regex, not just a fixed string separator. Clarified the corner case behaviors too. --- ChangeLog | 6 ++++++ txr.1 | 26 ++++++++++++++++++-------- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index a84ea302..daea3034 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2013-05-20 Kaz Kylheku + + * txr.1: Misleading documentation updated for split-str, which + takes a regex, not just a fixed string separator. Clarified + the corner case behaviors too. + 2013-05-16 Kaz Kylheku Version 66 diff --git a/txr.1 b/txr.1 index e4094d39..433c74c2 100644 --- a/txr.1 +++ b/txr.1 @@ -7514,14 +7514,24 @@ Syntax: Description: The split-str function breaks the into pieces, returing a list -thereof. The argument must be a string. It specifies the separator -character sequence within . All non-overlapping occurences of - within are identified in left to right order, and are removed -from . The string is broken into pieces according to the gaps left -behind by the removed separators. - -Adjacent occurrences of within are considered to be separate -gaps which come between empty strings. +thereof. The argument must be either a string or a regular expression. +It specifies the separator character sequence within . + +All non-overlapping matches for within are identified in left +to right order, and are removed from . The string is broken into pieces +according to the gaps left behind by the removed separators, and a list +of the remaining pieces is returned. + +If a match for is not found in the string at all, then the string is not +split at all: a list of one element is returned containing the original +string. + +If matches the entire string, then a list of two empty strings is +returned, except in the case that the original string is empty, in which case a +list of one element is returned, containing the empty string. + +Whenever two adjacent matches for occur, they are considered separate +cuts with an empty piece between them. This operation is nondestructive: is not modified in any way. -- cgit v1.2.3