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

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

Thread Previous | Thread Next
From:
Juerd
Date:
May 25, 2005 11:20
Subject:
Re: (1,(2,3),4)[2]
Message ID:
20050525181950.GH31996@c4.convolution.nl
Mark Reed skribis 2005-05-25 14:09 (-0400):
> > 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;

You could, if you changed the precedence of , to be tighter than =.

However, by default, = has higher precedence than ,, so that you need
parens to override this decision: @a = (1,2,3);


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

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