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

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

Thread Previous | Thread Next
From:
Stuart Cook
Date:
May 25, 2005 20:50
Subject:
Re: (1,(2,3),4)[2]
Message ID:
49b35106050525205010e73bfa@mail.gmail.com
On 5/26/05, Juerd <juerd@convolution.nl> wrote:
> 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);

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
my @foo = 3, 4, 5; # @foo should contain (3, 4, 5), not (list 3)

What justification for the status quo could be so compelling that we
feel the need to prevent both of these from doing the 'natural' thing?


Stuart

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