On Sun, Dec 16, 2001 at 03:55:10PM +1100, Damian Conway wrote:

[...]

>    > And, just for laughs:
>    > 
>    > $ref = [1,2];
>    > @ary[$ref] = foo();      # probably a syntax error

Ok, as far as I can recall, Larry hinted that arrays and references to
arrays would be interchangable in many contexts in P6. In this case, I
can't see any reason that subscripting would *want* to do a SvIV on
a known reference, so I would expect it to obey that logic and treat
the reference as an array. Thus, I expect this to be list context for
the exact same reason that:

        @bar = (1,2);
        @ary[@bar] = foo();

would be.

Next question, though:

        $val = (foo())[0];

List?

-- 
Aaron Sherman
[EMAIL PROTECTED]             finger [EMAIL PROTECTED] for GPG info. Fingerprint:
www.ajs.com/~ajs        6DC1 F67A B9FB 2FBA D04C  619E FC35 5713 2676 CEAF
  "Write your letters in the sand for the day I'll take your hand
   In the land that our grandchildren knew." -Queen/_'39_

Reply via email to