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)