[Haskell-cafe] Precedence of plus and bit-wise-and

Doug McIlroy doug at cs.dartmouth.edu
Wed Aug 16 12:55:53 UTC 2017


Sorry for hitting return prematurely. The final sentence below
tells the tale.
The reason for the low precedence of & and | in PL/I and C is
that those were used as Boolean operators in conditions. For
example
        lessequal(a,b) { return(a<b | a==b); }
That usage was baked in before the short-cut operators && and ||
were introduced in C.

doug


More information about the Haskell-Cafe mailing list