chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] Anyone know why I can't split with an empty string i


From: joshua
Subject: Re: [Chicken-users] Anyone know why I can't split with an empty string in (chicken irregex)?
Date: Fri, 3 May 2019 14:16:15 -0500
User-agent: Mutt/1.10.1 (2018-07-13)

On Thu, May 02, 2019 at 02:17:25PM +0200, Peter Bex wrote:
> 
> Hm, that is somewhat surprising.  I checked irregex upstream,
> but as far as I can tell, this has never worked.  In extremely
> old versions this would raise an internal error and in newer
> versions it returns the empty list.
> 
> I can take a look but I'm not even sure what the correct behaviour is
> supposed to be.
> 

I guess I expected something like this (from Ruby):

home> rlwrap irb
irb(main):001:0> "foobar".split(//)
=> ["f", "o", "o", "b", "a", "r"]
irb(main):002:0> "foobar".split(/\s*/)
=> ["f", "o", "o", "b", "a", "r"]

Even if "" didn't work, I would expect "\\s*" to tokenize a string, eliminating 
whitespace.


joshua




reply via email to

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