head 1.2; access; symbols; locks ulrich:1.2; strict; comment @# @; 1.2 date 2010.07.17.09.57.34; author ulrich; state Exp; branches; next 1.1; 1.1 date 2009.10.19.17.48.50; author ulrich; state Exp; branches; next ; desc @@ 1.2 log @Changes at ICLP @ text @
A 2. WG 17 resolves that call/2-N of 8.15.4 in N 208 shall require all implementations to support at least an arity of 8 (allowing seven extra arguments). The exact number shall be implementation dependent, with errors determined by the resulting call to a possibly non existent predicate.References refer to 13211-1:1995. Parts needing improvements are underlined.
TBD: control construct 7.8 vs. built-in 8.15 Logic and control.
NOTE — A built-in predicateapply/2
is implemented in many existing processors. In most uses it can be directly replaced bycall/N
. @@@@@@
call(C, Arg1, ...)
is true iff call(Goal)
is
true where Goal is constructed by appending Arg1, ... additional
arguments to the arguments (if any) of C
.
Thus, a goal
call(p(X1,...,XM), Y2, ...,
YN)
is replaced by
call(p(X1, ..., XM, Y2, ...,
YN))
.
call(+callable_term, ?term, ...)
C
is a variableinstantiation error
.
C
is neither a variable nor a callable termtype_error(callable, C)
. (Remark: in other words C is a
number).
representation_error(max_arity)
.
call/9
is called. It is implementation dependent
whether or not this error is produced.existence_error(procedure,call/9)
.
NOTE — Due to the error in subclause d being implementation dependent (3.91), a conforming processor may implement call/N in one of the following ways.Implementation dependence also means that it is neither required nor forbidden to define the chosen approach in the processor documentation (5.4).
- 1) Implement the minimum, which are the seven built-in predicates
call/2
up tocall/8
.- 2) Implement
call/2..N
up to any N that is within8..max_arity (7.11.2.3)
and produce existence errors for larger arities belowmax_arity
.- 3) Implement
call/9
and above only for certain execution modes.
call(integer, 3). Succeeds. call(functor(F,c), 0). Succeeds, unifying F with c. call(atom_concat(pro), log, Atom). Succeeds, unifying Atom with prolog. call(',', X = 1, Y = 2). Succeeds, unifying X with 1 and Y with 2. call(;, (true->fail), X=1). Fails.
C
is neither a variable nor a callable termtype_error(callable, C)
. (Remark: a and b may not be
needed, maybe call(1, 2) should rather produce a type error, similar
to (=..)/2.
d139 1
a139 1
NOTE — Due to the error in clause d being implementation
a172 1
d174 2
d177 3
a179 2
The ability to pass compound terms to call/N
in Prolog
is the equivalent of closures in LISP.
a181 1
call(p(X1,...,Xm), Y1, ..., Yn) :- p(X1, ..., Xm, Y1, ..., Yn).
@