Operator precedence of =>
Ralph Becket
rwab1 at cam.sri.com
Wed Jan 27 01:28:21 AEDT 1999
Hi,
I was hacking away t'other day, when I coded something of the form
all_p_and_q(Xs) :-
all [X] list__member(X, Xs) => p(X), q(X).
and lawks a lordy, all Hell broke loose within negated contexts. A
quick bit of parenthesization and we reduce to
all_p_and_q(Xs) :-
all [X] (
list__member(X, Xs) =>
( p(X), q(X) )
).
which solves the problem. Now, I'm not sure about other people, but
I'd find it more natural (not to say, more convenient) to have the
following precedence order (from most to least tightly binding):
conjunction < implication < quantification
rather than the current order
implication < quantification < conjunction
I'm much in favour of the functional communities (well, ML & Haskell
types at least) dispreference for extra bracketing.
This isn't a whinge, just a POV.
Ralph
--
Ralph Becket | rwab1 at cam.sri.com | http://www.cam.sri.com/people/becket.html
More information about the users
mailing list