Larry Wall skribis 2005-09-09  8:58 (-0700):
> The decision to copy is made by the =, not by @a.  This also copies:
>     ($a,$b) = ($b,$a)
> This is how Perl 5 assignment works, and we're trying not to break that...

This is all true.

However, back to the scalar case, assuming the comma/alias thing:

    my $a = [ $foo, $bar ];  # RHS copies values

    my $a = ($foo, $bar);    # RHS does not copy values

    my @a = ($foo, $bar);    # RHS does not copy values: consistent
    
It is fun to see that my whitespace style (whitespace in constructors,
but not in parens, because they do not construct) works very well in
Perl 6: it is not the parens that construct the array in scalar context,
it is something else.


Juerd
-- 
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html 
http://convolution.nl/gajigu_juerd_n.html

Reply via email to