Unexpected syntax extension
?- op(1000,xfx,~>).
true.
?- writeq([a~>b]).
outputs("[(a~>b)]"), unexpected.
syntax_error(...).
6.3.3.1 Arguments ...
arg = term ;
Abstract: a a
Priority: 999
Interesting. I thought it was weird that doing exactly 1000 priority worked, because that is the same priority as (',')/2. It also seems to be a problem in Trealla.
Interesting. I thought it was weird that doing exactly 1000 priority worked, ...
Seems to be related to the specific parsing method, since also Prolog IV shows the same behavior. And only for xfx.
(Trealla does permit any priority for the arguments, like SWI. Even [a:-b,c].
?- op(1000,xfx,~>).
true.
?- writeq([a~>b]).
syntax_error(...).
?- op(1000,yfx,~>).
true.
?- writeq([a~>b]).
syntax_error(...).
just to clarify, this is the expected behavior? anything else more general?
The elements of lists are of the form arg and thus constrained to priority 999. And thus an operator with priority 1000 is invalid no matter its associativity. In 6.3.3.1 Arguments:
arg = term ;
Abstract: a a
Priority: 999
got it.
3e6da5ad
J.J.'s robot