guile-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] add regexp-split


From: Daniel Hartwig
Subject: Re: [PATCH] add regexp-split
Date: Fri, 30 Dec 2011 23:23:16 +0800

On 30 December 2011 19:47, Nala Ginrut <address@hidden> wrote:
> Forget to load (srfi-1 iota) ,again...
>
>
> On Fri, Dec 30, 2011 at 7:40 PM, Nala Ginrut <address@hidden> wrote:
>>
>> Great! It's better now.
>> Here's the brand new patch~

I notice that this does not handle the case where there are no matches:

scheme@(guile-user)> (regexp-split "[^0-9]" "123")
$26 = ((""))


  (let ((ret (fold-matches
              regex str (list '() 0 '(""))

becomes:

  (let ((ret (fold-matches
              regex str (list '() 0 str)

and the result:

scheme@(guile-user)> (regexp-split "[^0-9]" "123")
$28 = ("123")
scheme@(guile-user)> (string-split "123" #\!)
$29 = ("123")


I also note that you are using `substring/shared' when I think you are
after `substring'.  Both of these are efficient and use shared memory
when they can, but there is a difference.



reply via email to

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