in reply to Perl 6 - Operator renaming
What I'd really like to see change, is not the shape of the operators ( . becomes ~, -> becomes . or nothing, & becomes +& or ~&, sub { becomes {,... ). It's the precedence of operators.
I understand that in perl6, comma had to have a higher precedence than assignment, for C compatibility. But is this the case with perl6 too? In perl6, the comma will not have its perl5 meaning in scalar context anymore, so couldn't we also raise the precedence of the comma, so that we can write @numbers = 12, 5, 4, 8, 9, 11; instead of @numbers = (12, 5, 4, 8, 9, 11);? Also, will concatenation finally have lower precedence than addition and subtraction? It's a bit annoying in perl5 that their precedence is equal, so you have to parenthisize print "2 + 5 = " . (2 + 5);.
Update 2006 Jun 12: Funnily, list assignment now has a low enough precedence in perl6 for this to work.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Perl 6 - Operator renaming
by TimToady (Parson) on Sep 08, 2005 at 15:07 UTC | |
by Happy-the-monk (Canon) on Sep 08, 2005 at 15:17 UTC |