Re: RFC 231 (v1) Data: Multi-dimensional arrays/hashes and slices

[email protected] ("Jeremy Howard") Sat, 23 Sep 2000 07:48:50 +1100
Newsgroups perl.perl6.language.data
Message-ID <001101c024d6$85165b10$0100a8c0@jeremy>
Karl Glazebrook wrote:
> Ilya Zakharevich wrote:
> >   f(3*@a)
> > 
> > would typically be a list context - and suddently instead of 3*(1+$#a)
> > you get C<map 3*$_, @a>.
> 
> This is true, what I would propose is we declare 3*(1+$#a) outmoded and
> always have it mean C<map 3*$_, @a> in all contexts.
> 
> This of course will break perl5 code. Note mine because I always say
> 3*scalar(@a) because 3*@a does not look like 3*(1+$#a) to me. I don't
> know how many people would depend on that feature.
> 
The P52P6 converter would map:

  @arr1 op @arr2

to

  scalar(@arr1) op scalar(@arr2)

in a list context (and the equivalent for '$scalar op @arr' of course).