Slicing conflict

2005-04-11 Thread Luke Palmer
In Perl 5: my @a = (1,2,3); my @b = @a[0..3]; print scalar(@b); # 4 But in Perl 6: my @a = (1,2,3,4); my @b = @a[1...]; # elements from 1 onward say [EMAIL PROTECTED]; # should probably be 3, but with Perl 5 semantics is Inf We have to break one of these. I think

Re: Slicing conflict

2005-04-11 Thread Autrijus Tang
On Tue, Apr 12, 2005 at 12:30:42AM -0600, Luke Palmer wrote: > But in Perl 6: > > my @a = (1,2,3,4); > my @b = @a[1...]; # elements from 1 onward > say [EMAIL PROTECTED]; # should probably be 3, but with Perl 5 > semantics is Inf In Pugs (r1847), after the IType refactoring, I hav

Re: Slicing conflict

2005-04-12 Thread Brent 'Dax' Royal-Gordon
Luke Palmer <[EMAIL PROTECTED]> wrote: > In Perl 5: > > my @a = (1,2,3); > my @b = @a[0..3]; > print scalar(@b); # 4 > > But in Perl 6: > > my @a = (1,2,3,4); > my @b = @a[1...]; # elements from 1 onward > say [EMAIL PROTECTED]; # should probably be 3, but with Perl

Re: Slicing conflict

2005-04-12 Thread Larry Wall
On Tue, Apr 12, 2005 at 12:08:43AM -0700, Brent 'Dax' Royal-Gordon wrote: : I was thinking about this today, actually, because my CS textbook was : talking about multidimensional arrays. If we make an infinite index : mean "slice until you can slice no more", then we can possibly have a : C> which

Re: Slicing conflict

2005-04-12 Thread Brent 'Dax' Royal-Gordon
Larry Wall <[EMAIL PROTECTED]> wrote: > On Tue, Apr 12, 2005 at 12:08:43AM -0700, Brent 'Dax' Royal-Gordon wrote: > : @foo[1,3; *; 7] > : > : Which I rather like. > > Me too. Unless my memory is failing me, I believe that's what S09 > already specifies. It does include a C> (d'oh, should've