develooper Front page | perl.perl5.porters | Postings from July 2010

Re: Order of evaluation of terms (was peephole optimiser could prune more dead code)

Thread Previous | Thread Next
From:
demerphq
Date:
July 15, 2010 15:26
Subject:
Re: Order of evaluation of terms (was peephole optimiser could prune more dead code)
Message ID:
AANLkTikBGEVD0SuBCQDPLIlpqLJ60L9vebJaLTbq2Xwh@mail.gmail.com
On 15 July 2010 21:42, Zefram <zefram@fysh.org> wrote:
>>                                         And because terms are left
>>associative,
>
> It's meaningless to speak of the associativity of a term (atomic
> expression).  The concept of associativity only applies to infix
> operators.  There is in fact a doc bug here, in that perlop ascribes
> associativity to terms and to "list operators (leftward)" (a list operator
> expression viewed from the left, from where it looks like a term).

Well, i think there is an ironic misparse involved, and not so much a
doc bug. The docs say:

       Terms and List Operators (Leftward)

but this is in a /section heading/. Looking at the other section
headings I seems that none of them mention anything about
associativity. So I think that the above should not be parsed as:

(Terms and List Operators) (Leftward)

but in fact

(Terms) and (List Operators (Leftward))

Or alternatively:

Terms and Leftward List Operators.

That is, the "(Leftward)" is meant to be a property of List Operators,
but not of Terms.

The only problem with this interpretation is that there are no "right
associative" list operators, but perhaps the author was being
conservative and assumed that maybe one day there would be...

cheers,
yves



-- 
perl -Mre=debug -e "/just|another|perl|hacker/"

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