Browse Prior Art Database

Exception-Handling Mechanism for Expression-Oriented Programming Languages

IP.com Disclosure Number: IPCOM000041736D
Original Publication Date: 1984-Mar-01
Included in the Prior Art Database: 2005-Feb-02
Document File: 5 page(s) / 22K

Publishing Venue

IBM

Related People

Nackman, LR: AUTHOR [+2]

Abstract

The object bound to an exception identifier need not be a subroutine but may be a subroutine, an expression, a label, a boolean or an identifier object. The action taken depends on the object. If the object bound to an exception identifier is an identifier, the action taken when the specified exception is raised is to raise the exception whose name is the second identifier. In this way, exceptions can be organized into hierarchical classes using the ordinary binding mechanism. Background. Most programming languages provide some mechanism for specifying what action is to be taken when an error is detected during program execution. When an error is detected, we say that an exception is raised. The action taken by a program when an exception is raised is determined by the exception handler defined for that particular exception.

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 20% of the total text.

Page 1 of 5

Exception-Handling Mechanism for Expression-Oriented Programming Languages

The object bound to an exception identifier need not be a subroutine but may be a subroutine, an expression, a label, a boolean or an identifier object. The action taken depends on the object. If the object bound to an exception identifier is an identifier, the action taken when the specified exception is raised is to raise the exception whose name is the second identifier. In this way, exceptions can be organized into hierarchical classes using the ordinary binding mechanism. Background. Most programming languages provide some mechanism for specifying what action is to be taken when an error is detected during program execution. When an error is detected, we say that an exception is raised. The action taken by a program when an exception is raised is determined by the exception handler defined for that particular exception. A key issue in the design of a programming language's exception-handling mechanism is how the correspondence between exceptions and exception handlers is established. This article addresses that problem for languages that allow expressions to be manipulated as data objects. An exception-handling mechanism should satisfy the following objections: 1. A subroutine (or other scope block) should be able to associate an exception handler with any exception that can occur during an invocation of the subroutine. When the subroutine (or scope block) terminates, such associations should be deleted. 2. It should be possible to specify an exception handler for one exception without having to modify (or know) the exception handler for that or any other exception. 3. It should be possible to specify an exception handler for a class of exceptions in the same manner as for a single exception. 4. It should be easy for a program to change the definition of exception classes. 5. Certain exception-handling paradigms (e.g., branching to an error handler, setting a flag, calling a subroutine, etc., are used frequently. It should be possible to specify such exception handlers concisely and efficiently.
6. User programs should be able to define the raise expectations in the same manner that the language evaluator does. 7. No language constructs specific to exception handling should be introduced since such constructs increase the user's learning burden and increase the complexity of the language and its implementation. Prior Art. Most languages provide a mechanism that can be used to associate an exception handler with an exception; none satisfies all of the objectives set forth above. We summarize several of these mechanisms: PL/I Exceptions are grouped together into named classes called "conditions." Exception handlers, called "on conditions," are defined by executing a special language construct that associates a statement or a BEGIN...END block with a condition. When an exception is raised, the statement or block defined by the most recently executed on co...