[Top][All Lists]

[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: Peter Bex
Subject: Re: [Chicken-users] Anyone know why I can't split with an empty string in (chicken irregex)?
Date: Thu, 2 May 2019 14:17:25 +0200
User-agent: NeoMutt/20170113 (1.7.2)

On Wed, May 01, 2019 at 11:18:31PM -0500, joshua wrote:
> I can't seem to figure out how to split a string into individual characters.

Hi Joshua,

The canonical way to do that would be string->list.

> I could swear this worked before, in Chicken 4.
> I'm now using Chicken 5.0.0 running on Void Linux.
> #;1> (import (chicken irregex))
> ; loading /usr/lib/chicken/9/ ...
> #;2> (irregex-split (irregex ",") "foo,bar,baz")
> ("foo" "bar" "baz")
> #;3> (irregex-split (irregex " ") "foo bar baz")
> ("foo" "bar" "baz")
> #;4> (irregex-split (irregex "") "foobarbaz")
> () ; wat

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.


Attachment: signature.asc
Description: PGP signature

reply via email to

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