sitelogo
fcall/1

Executes a goal only once and throws an exception if the goal fails.

fcall(?Goal)

fcall/1 works like once/1, but throws an exception if the execution of Goal fails.

Arguments

Goal                   goal

Examples

fcall((member(X,[a,b,c]))). Succeeds only once with substitution X <- a.
fcall((member(d,[a,b,c]))). throws an exception.

Standard

This predicate is not part of the ISO-Prolog Standard.

See also

abort/0, break/0, call/1, catch/3, ','(conjunction)/2, '!'(cut)/0, ';'(disjunction)/2, fail/0, true/0, halt/0/1, '->'(if-then)/2, ';'(if-then-else)/2, '\+'(not provable)/1, repeat/0, throw/1.


Darueber read on...
scroll to top managed with ubiCMS