develooper Front page | perl.perl6.language.data | Postings from September 2000

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

Thread Previous | Thread Next
From:
Jeremy Howard
Date:
September 22, 2000 13:48
Subject:
Re: RFC 231 (v1) Data: Multi-dimensional arrays/hashes and slices
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).



Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About