sten
sten

Reputation: 7486

Can atom be both predicate and operator?

Is it possible to use atom as both operator and predicate. Something along the lines :

:- op(101, fy, rule).
:- op(99,  xfy, ==>).
rule(R) :- write_canonical(R).

So that I can say :

 rule ...blah... ==> ...abc..

instead of :

 rule( ...blah... ==> ...abc.).

Upvotes: 0

Views: 63

Answers (1)

sten
sten

Reputation: 7486

As lurker said, the problem was resolved when I set correct precedence.

In your specific case it will depend what else you have defined and how do you use it.

To check for conflicting precedence use current_op/3.

Upvotes: 1

Related Questions