I assumed (2) in the reference implementation, for the description of
empty delimiter would be a kind of inconsistent in (1)  (Well, null delimiter
is special anyway, but if we take the "delimiter string as char-set" apparoach,
empty string is empty set that strongly suggests the string won't be split.)

For practical use, it'd be handy if string-split supports a string, a char-set,
a predicate or regexp; Gauche's string-split already does that.  But those
extensions can be added later, so I wonder how much this srfi should cover.



On Fri, Apr 15, 2016 at 6:44 PM, Per Bothner <xxxxxx@bothner.com> wrote:
"Delimiter specifies a string whose characters are to be used as the word separator."

Does this mean:
(1) Delimiter specifies a char-set composed of the characters in it;
if a character is 's matches *any* character in 'delimiter' it's a word boundary.
(2) A delimiter can match multiple characters, and the scan is as if done by
string-contains?

I suspect (1) is intended, but it does have the problem mentioned in my
"deprecate or generalize string-tabulate and string-unfold?"
that doesn't handle grapheme clusters etc.

The delimiter should probably be a regex, so maybe deferred to another library.
It strings are allowed should "abc" be interpreted as /[abc]/ or /abc/.
I think the latter is cleaner.
--
        --Per Bothner
xxxxxx@bothner.com   http://per.bothner.com/
To unsubscribe from this list please goto http://www.simplelists.com/confirm.php?u=nLyM1oDb1Nkjw7bZXJe5PCqYGwwgEA0F