call/1

executes a goal.

call(?Goal)

call/1 succeeds if Goal is executable. By backtracing Goal can have more than one solution.
The effect of a cut occuring in Goal is limited to this goal. It has no effect outside of call/1.
call/1 is a metacall.

Arguments

Goal                   goal

Examples

X=integer(3), call(X). Succeeds.
call(write('hallo')). Succeeds.
call(!),fail;true. Succeeds.
call((!,fail;true)). Fails.
X=f(a),call(X). existence_error(procedure,f/1).

Standard

This predicate is part of the ISO-Prolog Standard.

See also

abort/0, break/0, fcall/1, catch/3, ','(conjunction)/2, '!'(cut)/0, ';'(disjunction)/2, fail/0, true/0, halt/0/1, '->'(if-then)/2, ';'(if-then-else)/2, '\+'(not provable)/1, once/1, repeat/0, throw/1.


Up read on...