On Thu, Sep 12, 2013 at 11:48:02AM -0700, Carl Mäsak via RT wrote:
> These days, it fails.
> 
> <masak> rn: my @a = [1], [2], [3]; say (map { @a[1 - $_][0] }, 0 .. 
> 3).perl
> <camelia> niecza v24-95-ga6d4c5f: OUTPUT«(2, 1, Any, Any).list␤»
> <camelia> ..rakudo 69c3cc: OUTPUT«(2, 1, Failure.new(exception => 
> X::AdHoc.new(payload => "Cannot use negative index -1 on Array")), 
> Failure.new(exception => X::AdHoc.new(payload => "Cannot use negative 
> index -2 on Array"))).list␤»
> * masak amends RT #98954
> 
> Which is arguably more correct than silently truncating the result list. 
> (But still different from both Beijing and Niecza.)

S09:683 says that "Negative subscripts are never allowed for standard
subscripts unless the subscript is declared modular."

I know S09 is slushy, but afair once the whatever star notation was
introduced it's always been the intent that negative indices would
fail unless explicitly declared to be valid somehow.

Pm

Reply via email to