[Next] [Previous] [Up] [Top] [Contents] [Index]

11 The Built-In Classes

Conditions

Conditions

<condition> [Open Abstract Class]


The class of objects used by the condition system to connect a signaler with an appropriate handler.

Superclasses:
<object>

Init-keywords:
None.

Description:
The class of condition objects. A complete description of conditions is given in Chapter 7, "Conditions."

Operations:
The class <condition> provides the following operations:
Functions on <condition> (continued)
Function DescriptionPage
signal Signals a condition.344
error Signals a non-recoverable error.344
cerror Signals a correctable error.345
break Invokes the debugger.346
Generic functions on <condition> (continued)
Function DescriptionPage
default-handler Called if no dynamic handler handles a condition.347
return-query Called to query the user and return.348
return-allowed? Returns true if a condition's recovery protocol allows returning values.349
return-description Returns a description of a condition's returned values.350
:
Methods on <condition> (continued)
Function DescriptionPage
default-handler Called if no dynamic handler handles a condition.347

Serious Conditions

<serious-condition> [Open Abstract Class]


The class of conditions that cannot safely be ignored.

Superclasses:
<condition>

Init-keywords:
None.

Description:
The class of conditions that cannot safely be ignored.

Operations:
The following operations are defined on <serious-condition>.:
Methods on <serious-condition> (continued)
Function DescriptionPage
default-handler Called if no dynamic handler handles a condition.347

Errors

<error> [Open Abstract Class]


The class of conditions that represent something invalid about the program.

Superclasses:
<serious-condition>

Init-keywords:
None.

Description:
The class of serious conditions that represent program errors.

<error> is distinct from <serious-condition> so one can establish a handler for errors that does not also trap unpredictable environmental exceptions such as network problems.

Operations:
None.

<simple-error> [Sealed Instantiable Class]


The class of error conditions that consist of just an error message constructed from a format string and arguments.

Superclasses:
<error>

Init-keywords:
format-string:
An instance of <string>. A format string describing the error.

format-arguments:
An instance of <sequence>. Format arguments to splice into the format string to describe the error.

Description:
The class of error conditions that consist of just an error message constructed from a format string and arguments.

The recovery protocol of <simple-error> is empty.

Operations:
The class <simple-error> provides the following operations:
Functions on <simple-error> (continued)
Function DescriptionPage
condition-format-string Returns the format string of a simple condition.350
condition-format-arguments Returns the format arguments of a simple condition.351

<type-error> [Sealed Instantiable Class]


The class of error conditions generated by type checks.

Superclasses:
<error>

Init-keywords:
value: An instance of <object>. The object whose type was checked.

type:
An instance of <type>. The type which was expected. The error was signaled because the object was not of this type.

Description:
The class of errors indicating that an object was not of the expected type.

The recovery protocol is empty.

Operations:
The class <type-error> provides the following operations::
Functions on <type-error> (continued)
Function DescriptionPage
type-error-value Returns the value which was not of the expected type.351
type-error-expected-type Returns the expected type of the type check that led to the type error.351

<sealed-object-error> [Sealed Class]


The class of errors that are generated by sealing violations.

Superclasses:
<error>

Init-keywords:
None.

Description:
The class of errors that indicate the violation of a sealing restriction.

Operations:
None.

Warnings

<warning> [Abstract Class]


The class of conditions that are interesting to users but can safely be ignored.

Superclasses:
<condition>

Init-keywords:
None.

Operations:
The following operations are defined on <warning>:
Methods on <warning> (continued)
Function DescriptionPage
default-handler Called if no dynamic handler handles a condition.347

Description:
The class of conditions that can be safely ignored.

There is a default handler for <warning> that displays the warning in a user-interface dependent way and then returns #f. The recovery protocol is that any value can be returned and will be ignored.

<simple-warning> [Sealed Instantiable Class]


A default class of warnings which are described by a warning string.

Superclasses:
<warning>

IInit-keywords:
format-string:
An instance of <string>. A format string describing the warning.

format-arguments:
An instance of <sequence>. Format arguments to splice into the format string to describe the warning.

Description:
The class of warnings described by a format string and arguments.

The recovery protocol is that any value can be returned and will be ignored.

Operations:
The class <simple-warning> provides the following operations:
Functions on <simple-warning> (continued)
Function DescriptionPage
condition-format-string Returns the format string of a simple condition.350
condition-format-arguments Returns the format arguments of a simple condition.351

Restarts

<restart> [Open Abstract Class]


The class of conditions used for restarting a computation.

Superclasses:
<condition>

Init-keywords:
condition: #f or an instance of <condition>. This argument is accepted and ignored by <restart>; some subclasses save the value of this initialization argument and use it to associate a restart with a particular condition from which the restart can recover. No such subclasses are defined as part of the language. Other restarts do not care; they can recover from any condition.

Description:
The class of conditions used to correct an unusual situation.

There is a default handler for <restart> that signals an error reporting an attempt to use a restart for which no restart handler was established. The recovery protocol concept is not applicable to restarts.

Operations:
The class <restart> provides the following operations:
Generic functions on <restart> (continued)
Function DescriptionPage
restart-query Called to query the user and restart.348
Methods on <restart> (continued)
Function DescriptionPage
default-handler Called if no dynamic handler handles a condition.347

<simple-restart> [Sealed Instantiable Class]


A default class of restarts.

Superclasses:
<restart>

Init-keywords:
format-string:
An instance of <string>. A format string describing the restart.

format-arguments:
An instance of <sequence>. Format arguments to splice into the format string to describe the restart.

Description:
A default class of restarts.

Typical implementations will use the format string and format arguments to produce a description of the restart.

Operations:
The class <simple-restart> provides the following operations:
Functions on <simple-warning> (continued)
Function DescriptionPage
condition-format-string Returns the format string of a simple condition.350
condition-format-arguments Returns the format arguments of a simple condition.351

Aborts

<abort> [Sealed Instantiable Class]


The class of conditions used to terminate a computation.

Superclasses:
<restart>

Init-keywords:
None.

Description:
The class of conditions used to terminate a computation.

Handlers are expected to terminate execution of the current application command, or similar unit of execution, and return control to something like an application command loop. This is comparable to command-period on the Macintosh. The exact details of this feature depend on the particular environment, of course, but signaling an instance of <abort> is a uniform way to "get out."

Operations:
None.


Dylan Reference Manual - 17 OCT 1995
[Next] [Previous] [Up] [Top] [Contents] [Index]

Generated with Harlequin WebMaker