guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: regexp-split for Guile


From: Daniel Hartwig
Subject: Re: regexp-split for Guile
Date: Sun, 7 Oct 2012 10:38:43 +0800

On 19 September 2012 03:59, Chris K. Jester-Young <address@hidden> wrote:
> (define* (regexp-split pat str #:optional (limit 0))
> […]
>     (reverse (if (zero? limit)
>                  (drop-while string-null? final)
>                  final))))
>

Please simplify this limit arg, removing the maybe-drop-empty-strings
behaviour.  Either positive limit or #f for all matches.  It is
trivial for the caller to remove the empty strings if desired, and
simplifies the docs for regexp-split.  Matching perl semantics is not
necessarily desirable.

The discussion following the previous thread (started by Nala) is
quite useful.  Semantics of many other implementations were examined
and a good summary later included.  (Which does remind me to get back
to that TODO list…)

Regards



reply via email to

[Prev in Thread] Current Thread [Next in Thread]