Author(s): Adapted from SICStus 0.6 code; modifications and documentation by Daniel Cabeza and Manuel Carro.
Version: 1.10#6 (2004/8/7, 21:46:39 CEST)
Version of last change: 1.9#287 (2004/2/13, 18:59:4 CET)
Operators allow writting terms in a more clear way than the standard functional notation. Standard operators in Ciao are defined by this predicate (but note that the compiler itself defines more operators at compile time):
standard_ops :- op(1200,xfx,[:-]), op(1200,fx,[:-,?-]), op(1100,xfy,[;]), op(1050,xfy,[->]), op(1000,xfy,[',']), op(900,fy,[\+]), op(700,xfx,[=,\=,==,\==,@<,@>,@=<,@>=,=..,is,=:=,=\=,<,=<,>,>=]), op(550,xfx,[:]), op(500,yfx,[+,-,/\,\/,#]), op(500,fy,[++,--]), op(400,yfx,[*,/,//,rem,mod,<<,>>]), op(200,fy,[+,-,\]), op(200,xfx,[**]), op(200,xfy,[^]).
op(Precedence, Type, Name)
Declares the atom
Name to be an operator of the stated
Precedence (0 =<
Precedence =< 1200).
Name may also be a list of atoms in which case all of them are declared to be operators. If
Precedence is 0 then the operator properties of
Name (if any) are cancelled. Note that, unlike in
ISO-Prolog, it is allowed to define two operators with the same name, one infix and the other postfix.
op(+int, +operator_specifier, +atm_or_atm_list)
* ISO *
current_op(Precedence, Type, Op)
Op is currently an operator of type
Type and precedence
Op nor the other arguments need be instantiated at the time of the call; i.e., this predicate can be used to generate as well as to test.
current_op(?int, ?operator_specifier, ?atm)
* ISO *
current_prefixop(Op, Less, Precedence)
current_op/3, but it concerns only the prefix operators. It returns only one solution. Not a predicate for general use.
current_infixop(Op, LeftLess, Prec, RightLess)
current_op/3, but it concerns only infix operators. It returns only one solution. Not a predicate for general use.
current_postfixop(Op, Less, Precedence)
current_op/3, but it concerns only the postfix operators. It returns only one solution. Not a predicate for general use.
Go to the first, previous, next, last section, table of contents.