
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
   ingnored (cut).


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




Resatisfiable
      No.

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
