A condition is an object (a generalized instance of the class condition) that represents a specific situation detected during program execution. Conditions are used to alter the flow of control via signaling. While all detected errors are represented by conditions, not all conditions are errors.
Signaling Process:
Signaling involves raising a condition, which is then processed by a set of active handlers established dynamically (e.g., via handler-bind or handler-case). A handler is a function of one argument (the condition) that is invoked only if the condition matches the handler's associated type.
Handler Actions:
When a handler is invoked, it can:
- Decline: Return normally. The next most recent handler is then invoked. If no handlers remain,
error or cerror enters the debugger, while signal or warn returns nil. - Handle: Perform a non-local transfer of control using
go, return, throw, abort, or invoke-restart. - Defer: Postpone the decision by signaling another condition, resignaling the same condition, or forcing entry into the debugger.