handler-case

Name

handler-case -- Catches signalled exceptions and aborts computation

Type: special

Synopsis

handler-case( expr class body);

Arguments

expr

An expression to be evaluated

class

A subclass of <condition>.

var

The name for a binding in the corresponding body forms.

body

A sequence of expressions.

Description

handler-case establishes exception handlers for the duration of the execution of expr.

If during the execution of expr, a condition is signalled, and the condition is an instance of the class of one of the handler clauses, then the corresponding body forms are executed. In this case, the value(s) of the handler-case is the value(s) of the last body form in the handler clause. Furthermore, during the execution of the body forms, the handlers established by this handler-case are no longer active (the handler taking control unwinds the dynamic stack to this point before executing the body forms).

If the condition: keyword is used in a clause, then the condition object is bound to a variable var with the body forms in it's scope.

The clauses are checked in the order they are given in the handler-case.

If no condition is signalled during the execution of expr, then the values of the entire handler-case are the values returned by the expr.