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

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

Thread Previous | Thread Next
From:
Rob Kinyon
Date:
May 26, 2005 06:04
Subject:
Re: (1,(2,3),4)[2]
Message ID:
703844205052606045cf7f490@mail.gmail.com
> 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


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