11.3.32 call/[1,2,...,255] [ISO]

Synopsis

call(+P)

Proves (executes) P.

call(+P,?Q,...)

Executes the goal obtained by augmenting P by the remaining arguments.

Arguments

:P
callable, must be nonvar
Q
term ...

Description

If P is instantiated to an atom or compound term, then the goal call(P) is executed exactly as if that term appeared textually in its place, except that any cut (‘!’) occurring in P only cuts alternatives in the execution of P. Only call/1 is ISO.

Backtracking

Depends on P.

Exceptions

Call errors (see ref-sem-exc).

Examples

maplist/2 in library(lists) is defined as:

     maplist(Pred, Xs) :-
             (   foreach(X,Xs),
                 param(Pred)
             do  call(Pred, X)
             ).

See Also

ref-sem-cal.


Send feedback on this subject.