Executes a goal only once and throws an exception if the goal fails.
fcall/1 works like once/1, but throws an exception if the execution of Goal fails.
Goal goal
| fcall((member(X,[a,b,c]))). | Succeeds only once with substitution X <- a. |
| fcall((member(d,[a,b,c]))). | throws an exception. |
This predicate is not part of the ISO-Prolog Standard.
| scroll to top |
|