sitelogo
op/3

updates the definition of operators.

op(+Priority, +Type, +Operators)

Operators give the possibility to write compound terms with arity 1 or 2 in operator notation (as prefix, suffix resp. infix operators). This allows a better readability.
The priority of an operator is defined by Priority. An operator can be deleted by giving him the priority 0.
Type defines the type of Operator. The possible types are:

fx prefix not associative
fy prefix right-associative
xf postfix not associative
yf postfix left-associative
xfx infix not associative
xfy infix right-associative
yfx infix left-associative

If Operators is a list of operators, its definition or deleting will be made in the given order.

Arguments

Priority               integer between 0 and ...
Type                   atom (xf | yf | fx | fy | xfx | xfy | yfx)
Operator               atom

Examples

op(75, xfx, @@). Succeeds. @@ is now a non-associative infix operator with priority 75.
op(80, xfx, @@). Succeeds. @@ is now a non-associative infix operator with priority 80.

Standard

This predicate is part of the ISO-Prolog Standard.

See also

current_op/3, print/1/2, println/1/2, read/1/2, read_term/2/3, write/1/2, write_canonical/1/2, write_term/2/3, writeq/2.


Darueber read on...
scroll to top managed with ubiCMS