
once +Goal

   Succeeds if Goal succeeds, and removes all its alternatives --- equivalent
to call((Goal, !))



Arguments
   Goal                Goal.

Type
   Control

Description
   Used to find a single solution for Goal, alternative solutions are
   ignored (cut).


   Note that !/0 does not cut through once/1.




Modes and Determinism
   once(+) is det

Modules
   This predicate is sensitive to its module context (tool predicate, see @/2).

Fail Conditions
   Fails if Goal fails

Exceptions
     4 --- Goal is not instantiated.
     5 --- Goal is neither an atom nor a compound term.

Examples
   
Success:
      [eclipse]: once member(X, [1,2,3]).
      X = 1       % only first solution is bound.
      yes.

Fail:
      [eclipse]: once 1=2.
      no.

Error:
      once Goal.                     (Error 4).
      once "ls".                     (Error 5).
      once 1.0.                      (Error 5).





See Also
   call / 1, -> / 2
