Section "operators"

To lookup syntax operators we use ordinary Prolog facts. The predicate current_op/3 queries the current system and user syntax operators. The predicate op/3 defines a new operator or updates an existing operator.

The following syntax operators are predefined:

Table 1: Predefined Syntax Operators
Level Mode    Operators
1200 fx [:-, ?-, -->]
1200 xfx [:-]
1150
fx
[dynamic, discontiguous, multifile]
1100 xfy [;]
1050
xfy
[->]
1000 xfy [',']
900 fy [\+]
700 xfx [is, =, =.., <, =<, =\=, >=, >, =:=,
@<, @=<, \==, @>=, @>, ==]
600
xfy
[:]
500 yfx [+, -, /\, \/]
400 yfx [*, /, //, rem, xor, >>, <<, div, mod]
200 xfx
[**]
200 xfy
[^]
200
fy
[-, \]

The following syntax operator predicates are provided:

current_op(L, M, O): [ISO 8.14.4]
The predicate succeeds for every operator O with mode M and level L.
op(L, M, O): [ISO 8.14.3]
The predicate succeeds. As a side effect, a new operator O with mode M and level L is asserted.

Kommentare