guile-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] add regexp-split


From: Nala Ginrut
Subject: Re: [PATCH] add regexp-split
Date: Fri, 30 Dec 2011 18:56:57 +0800

Hmm, interesting!
I must confess I'm not familiar with Racket, but I think the aim of Guile contains practicality.
So I think regex-lib of Guile does this at least.
Anyway, I believe an implementation should do its best to provide any useful mechanism for the user. Or it won't be popular anymore.
When I talk about "useful", I mean "it brings the user convenient", not "the developer think it's useful".
Just my mumble, no any offense.
Thank you for telling us this issue. ;-)

On Fri, Dec 30, 2011 at 6:14 PM, Marijn <address@hidden> wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 29-12-11 10:32, Nala Ginrut wrote:
> hi guilers! It seems like there's no "regexp-split" procedure in
> Guile. What we have is "string-split" which accepted Char only. So
> I wrote one for myself.
>
> ------python code-----
>>>> import re re.split("([^0-9])", "123+456*/")
> [’123’, ’+’, ’456’, ’*’, ’’, ’/’, ’’] --------code end-------
>
> The Guile version:
>
> ----------guile code------- (regexp-split "([^0-9])"  "123+456*/")
> ==>("123" "+" "456" "*" "" "/" "") ----------code end--------
>
> Anyone interested in it?

Hi there,

I think we're all happy that Guile is getting this support, however I
couldn't help but notice that the above results look a bit funny and
indeed are incompatible with racket's implementation:

> (regexp-split "([^0-9])" "123+456*/")
'("123" "456" "" "")

Apparently because their version doesn't support capturing groups in
this function. I've raised the issue with them as well, but there are
some doubts that it is useful/sane to support this. Perhaps other
schemes' regexp libraries should be compared as well. Their tests
would certainly be useful and may point out other incompatibilities
that no-one is aware of (as well as improve your code(!)).

Marijn
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk79jwgACgkQp/VmCx0OL2zCrgCgrCtBGvKaejnfceWj8RaBz+lm
lfMAoIrR0qr8IFKhFG4KGBevf1LQfoZv
=2x7Y
-----END PGP SIGNATURE-----


reply via email to

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