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

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

Thread Previous | Thread Next
From:
Ben Morrow
Date:
July 15, 2010 15:55
Subject:
Re: Order of evaluation of terms (was peephole optimiser couldprune more dead code)
Message ID:
20100715225512.GA34622@osiris.mauzo.dyndns.org
Quoth demerphq@gmail.com (demerphq):
> 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...

This is more-or-less correct, but the contrast is with

    List Operators (Rightward)

much further down (the point being that list operators have different
precedence viewed from the left and from the right).

Ben


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