develooper Front page | perl.perl6.language | Postings from May 2005

Re: (1,(2,3),4)[2]

Thread Previous | Thread Next
From:
Mark Reed
Date:
May 25, 2005 11:09
Subject:
Re: (1,(2,3),4)[2]
Message ID:
BEBA3789.6297%mark.reed@turner.com



On 2005-05-25 13:54, "Juerd" <juerd@convolution.nl> wrote:

>> 3.  If you assign that to an array via something like @a = [1,2,3], I would
>> expect at least a warning and possibly a compile-time error.
>> 
>>  If it does work, it probably gets translated into @a = ([1,2,3]), which
> 
> That's not a translation. Parens, when not postfix, serve only one
> purpose: group to defeat precedence. $foo and ($foo) are always the same
> thing, regardless of the $foo.

So, you could then do this to make an array of size 3 in Perl6?

    @a = 1,2,3;



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