Next: , Previous: , Up: ref-sem   [Contents][Index]


4.2.5 Meta-Calls

If X is instantiated to a term that would be acceptable as the body of a clause, then the goal call(X) is executed exactly as if that term appeared textually in place of the call(X), except the scope of any cut occurring in X is limited to the execution of X. That is, the cut does not “propagate” into the clause in which call(X) occurs. If X is not properly instantiated, then an error exception is raised as described in ref-sem-exc.

In release 4, call/1 has been generalized to call/N of any arity N between 1 and 255: the first argument is treated as template, which should be augmented by the remaining arguments, giving the goal to call. For example, the goal call(p(X),Y,Z) is equivalent to the goal p(X,Y,Z). Note in particular that the first argument does not need to be an atom.


Send feedback on this subject.