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

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

Thread Previous | Thread Next
Rob Kinyon
May 26, 2005 06:04
Re: (1,(2,3),4)[2]
Message ID:
> Is giving "=" a higher precedence than "," still considered A Good Thing?
> I'm not familiar with the reasoning behind the current situation, but
> I'm struggling to come up with any good reasons for keeping it.
> Consider the alternative:
> my $a, $b = 1, 2; # $b should contain 2, not 1

I read this as
(my $a), ($b=1), 2;

The comma separates clauses in English (and other languages). Why
should it not be so in Perl?

If you need parens, then use them. I believe it was Larry who said
"When in doubt, parenthesize. At the very least, people can bounce on
them with % in vi."

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About