Did you know ... Search Documentation:
Pack ciao -- prolog/dialect/ciao/engine/exceptions.pl
PublicShow source

Re-exported predicates

The following predicates are exported from this file while their implementation is defined in imported modules or non-module files loaded by this module.

 intercept(:Goal, ?Ball, :Handler)
Run Goal as call/1. If somewhere during the execution of Goal send_signal/1 is called with a Signal that unifies with Ball, run Handler and continue the execution.

This predicate is related to catch/3, but rather than aborting the execution of Goal and running Handler it continues the execution of Goal. This construct is also related to delimited continuations (see reset/3 and shift/1). It only covers one (common) use case for delimited continuations, but does so with a simpler interface, at lower overhead and without suffering from poor interaction with the cut.

Note that Ball and Handler are copied before calling the (copy) of Handler to avoid instantiation of Ball and/or Handler which can make a subsequent signal fail.

See also
- intercept/4, reset/3, catch/4, broadcast_request/1.
- Ciao
If this predicate is called from a sub-goal of intercept/3, execute the associated Handler of the intercept/3 environment.
- unintercepted_signal(Signal) if there is no matching intercept environment.
As send_signal/1, but succeed silently if there is no matching intercept environment.

Undocumented predicates

The following predicates are exported, but not or incorrectly documented.

 catch(Arg1, Arg2, Arg3)