Common Lisp the Language, 2nd Edition

Next: Classes Up: Programmer Interface Concepts Previous: Programmer Interface Concepts

## 28.1.1. Error Terminology

The terminology used in this chapter to describe erroneous situations differs from the terminology used in the first edition. The new terminology involves situations; a situation is the evaluation of an expression in some specific context. For example, a situation might be the invocation of a function on arguments that fail to satisfy some specified constraints.

In the specification of the Common Lisp Object System, the behavior of programs in all situations is described, and the options available to the implementor are defined. No implementation is allowed to extend the syntax or semantics of the Object System except as explicitly defined in the Object System specification. In particular, no implementation is allowed to extend the syntax of the Object System in such a way that ambiguity between the specified syntax of the Object System and those extensions is possible.

``When situation S occurs, an error is signaled.''

  This terminology has the following meaning:

  - If this situation occurs, an error will be signaled in the interpreter and in code compiled under all compiler safety optimization levels.

  - Valid programs may rely on the fact that an error will be signaled in the interpreter and in code compiled under all compiler safety optimization levels.

  - Every implementation is required to detect such an error in the interpreter and in code compiled under all compiler safety optimization levels.

``When situation S occurs, an error should be signaled.''

  This terminology has the following meaning:

  - If this situation occurs, an error will be signaled at least in the interpreter and in code compiled under the safest compiler safety optimization level.

  - Valid programs may not rely on the fact that an error will be signaled.

  - Every implementation is required to detect such an error at least in the interpreter and in code compiled under the safest compiler safety optimization level.

  - When an error is not signaled, the results are undefined (see below).

``When situation S occurs, the results are undefined.''

  This terminology has the following meaning:

  - If this situation occurs, the results are unpredictable. The results may range from harmless to fatal.

  - Implementations are allowed to detect this situation and signal an error, but no implementation is required to detect the situation.

  - No valid program may depend on the effects of this situation, and all valid programs are required to treat the effects of this situation as unpredictable.

``When situation S occurs, the results are unspecified.''

  This terminology has the following meaning:

  - The effects of this situation are not specified in the Object System, but the effects are harmless.

  - Implementations are allowed to specify the effects of this situation.

  - No portable program can depend on the effects of this situation, and all portable programs are required to treat the situation as unpredictable but harmless.

``The Common Lisp Object System may be extended to cover situation S.''

  The meaning of this terminology is that an implementation is free to treat situation S in one of three ways:

  - When situation S occurs, an error is signaled at least in the interpreter and in code compiled under the safest compiler safety optimization level.

  - When situation S occurs, the results are undefined.

  - When situation S occurs, the results are defined and specified.

  In addition, this terminology has the following meaning:

  - No portable program can depend on the effects of this situation, and all portable programs are required to treat the situation as undefined.

``Implementations are free to extend the syntax S.''

  This terminology has the following meaning:

  - Implementations are allowed to define unambiguous extensions to syntax S.

  - No portable program can depend on this extension, and all portable programs are required to treat the syntax as meaningless.

The Common Lisp Object System specification may disallow certain extensions while allowing others.

Next: Classes Up: Programmer Interface Concepts Previous: Programmer Interface Concepts