RE: Split with negative limits, and other weirdnesses

2008-09-30 Thread Kealey, Martin, ihug-NZ
. Reed [mailto:[EMAIL PROTECTED] Sent: Monday, September 29, 2008 8:44 AM To: Chris Davaz Cc: Carl Mäsak; Perl6 Subject: Re: Split with negative limits, and other weirdnesses On Sun, Sep 28, 2008 at 11:40 AM, Chris Davaz [EMAIL PROTECTED] wrote: Ok, so 0 returns the empty list and -1

Re: Split with negative limits, and other weirdnesses

2008-09-29 Thread Mark J. Reed
On Mon, Sep 29, 2008 at 9:36 PM, Kealey, Martin, ihug-NZ [EMAIL PROTECTED] wrote: Hmmm, my understanding was that it stopped *splitting* after the limit, but it doesn't stop consuming the source; D'oh, you are of course correct; that is in fact the chief utility of the limit parameter, and I

Re: Split with negative limits, and other weirdnesses

2008-09-28 Thread Carl Mäsak
Jason (): It makes sense to me to go with option 1; you get what you ask for. It also makes sense to make to not use magical implied numbers, such as negatives, to accomplish things that either ranges or whatever star can accomplish. Aye, agreement. There's a whole lot of consensus already...

Re: Split with negative limits, and other weirdnesses

2008-09-28 Thread Chris Davaz
Ok, so 0 returns the empty list and -1 violates the signature? In PIR can we have such signatures that put a constraint on the range of values for a given parameter? On Sun, Sep 28, 2008 at 7:25 PM, Carl Mäsak [EMAIL PROTECTED] wrote: Jason (): It makes sense to me to go with option 1; you get

Re: Split with negative limits, and other weirdnesses

2008-09-28 Thread Mark J. Reed
On Sun, Sep 28, 2008 at 11:40 AM, Chris Davaz [EMAIL PROTECTED] wrote: Ok, so 0 returns the empty list and -1 violates the signature? In PIR can we have such signatures that put a constraint on the range of values for a given parameter? Maybe this has already been proposed and rejected, but

Re: Split with negative limits, and other weirdnesses

2008-09-27 Thread jason switzer
It makes sense to me to go with option 1; you get what you ask for. It also makes sense to make to not use magical implied numbers, such as negatives, to accomplish things that either ranges or whatever star can accomplish. Just my 2 cents. -Jason s1n Switzer On Tue, Sep 23, 2008 at 4:27 AM,

Re: Split with negative limits, and other weirdnesses

2008-09-25 Thread Chris Davaz
If someone wants to make the final word on what the behavior should be I can go ahead and implement it. On Tue, Sep 23, 2008 at 11:41 PM, Jonathan Scott Duff [EMAIL PROTECTED] wrote: On Tue, Sep 23, 2008 at 9:38 AM, TSa [EMAIL PROTECTED] wrote: HaloO, Moritz Lenz wrote: In Perl 5 a negative

Re: Split with negative limits, and other weirdnesses

2008-09-24 Thread Jonathan Scott Duff
On Tue, Sep 23, 2008 at 9:38 AM, TSa [EMAIL PROTECTED] wrote: HaloO, Moritz Lenz wrote: In Perl 5 a negative limit means unlimited, which we don't have to do because we have the Whatever star. I like the notion of negative numbers as the other end of infinity. Where infinity here is the

Split with negative limits, and other weirdnesses

2008-09-23 Thread Moritz Lenz
Today a patch to rakudo brought up the question what split() should do if the $limit argument is either zero or negative. In Perl 5 a negative limit means unlimited, which we don't have to do because we have the Whatever star. A limit of 0 is basically ignored. Here are a few solution I could

Re: Split with negative limits, and other weirdnesses

2008-09-23 Thread TSa
HaloO, Moritz Lenz wrote: In Perl 5 a negative limit means unlimited, which we don't have to do because we have the Whatever star. I like the notion of negative numbers as the other end of infinity. Where infinity here is the length of the split list which can be infinite if split is called

Re: Split with negative limits, and other weirdnesses

2008-09-23 Thread David Green
On 2008-Sep-23, at 8:38 am, TSa wrote: Moritz Lenz wrote: In Perl 5 a negative limit means unlimited, which we don't have to do because we have the Whatever star. I like the notion of negative numbers as the other end of infinity. I think positive values and zero make sense. But I don't