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

S03 Precedence for junctions

Thread Next
From:
Brad Bowman
Date:
April 17, 2005 03:56
Subject:
S03 Precedence for junctions
Message ID:
1113735406.1082.21.camel@oxum

Hi all,

S03 gives infix + a higher precedence than junctive
operators in the listed table, but that seems to contradict
the examples under "Junctive operators".

The relevant parts of S03 are:

  Junctive operators
            1|2|3 + 4;       # 5|6|7
            1|2 + 3&4;       # (4|5) & (5|6)

  Precedence
           multiplicative      * / % x xx +& +< +> ~& ~< ~>
           additive            + - ~ +| +^ ~| ~^
           junctive and (all)  &
           junctive or (any)   | ^


(1|2|3) + 4  => 5|6|7 but if + is higher precedence than |
 1|2|(3 + 4) => 1|2|7

pugs produces 1|2|7 currently, in keeping with S03

In this case is seems like raising junctive ops higher would
be correct, but there more to it?


Brad

-- 
After reading books and the like it is best to burn them or throw them away.
                                    -- Hagakure http://bereft.net/hagakure/


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