[ Control | Reference Manual | Alphabetic Index ]
Succeeds if Goal succeeds, and removes all its alternatives --- equivalent
to call((Goal, !))
Used to find a single solution for Goal, alternative solutions are
Note that !/0 does not cut through once/1.
Modes and Determinism
This predicate is sensitive to its module context (tool predicate, see @/2).
Fails if Goal fails
- (4) instantiation fault
- Goal is not instantiated.
- (5) type error
- Goal is neither an atom nor a compound term.
[eclipse]: once member(X, [1,2,3]).
X = 1 % only first solution is bound.
[eclipse]: once 1=2.
once Goal. (Error 4).
once "ls". (Error 5).
once 1.0. (Error 5).
call / 1, -> / 2