built-in method
once/1
Description
once(Goal)
This predicate behaves as call(Goal)
but it is not re-executable.
This built-in meta-predicate is declared as a private method and thus
cannot be used as a message to an object.
This meta-predicate is opaque to cuts in its argument.
Meta-predicate template
once(0)
Modes and number of proofs
once(+callable) - zero_or_one
Errors
Goal
is a variable:instantiation_error
Goal
is neither a variable nor a callable term:type_error(callable, Goal)
Examples
Call a goal deterministically in the context of the object or category containing the call:
once(Goal)
To send a goal as a non-backtracable message to self:
once(::Goal)
To send a goal as a non-backtracable message to an explicit object:
once(Object::Goal)