On Fri, Nov 21, 2008 at 10:43:15AM -0800, Moritz Lenz wrote:
> From #perl6 today:
> 
> 19:33 < moritz_> rakudo: my $x = [ 42 ]; say $x<0>
> 19:33 < p6eval> rakudo 32984: OUTPUT[42␤]
> 
> I don't think that should be allowed.

It's allowed at least for Match objects -- from S05:

    # The numbered captures may be treated as named, 
      so $<0 1 2> is equivalent to $/[0,1,2]. This allows 
      you to write slices of intermixed named and numbered captures.

I agree that it's probably not allowed in the general case of
indexing a List or Array, though.  We will probably fix this when 
we implement postcircumfix:<{ }> and postcircumfix:<[ ]> as part
of handling list and hash slices.

Pm

Reply via email to