Abstract

The purpose of this paper is to propose a new language feature, dubbed exception types, to support a more flexible exception paradigm in Ada. This mechanism attempts to retain compatibility with Ada 95, while providing a general communication framework similar to that which exists in C++ or Java.Ada 83 had a very basic exception mechanism. It was not possible to pass information when raising an exception, and exceptions were not integrated with the overall type structure of the language, making it impossible to pass exception-related information to subprograms, or to store it in data structures, etc.Ada 95 added slightly more powerful capabilities in this area, with the facilities provided by the predefined package Ada.Exceptions. However, the new mechanism is still only intended for very basic error detection and logging, and doesn't provide a general-purpose communication mechanism. It has the merit of clarifying the notions of exception identity and exception occurrence, but exceptions are still not integrated with the typing model like protected objects or tasks are.It is in fact possible to use the Message associated with an exception occurrence to pass (relatively small) objects when raising an exception, but this has to be done by marshalling the object into the string. While adequate for some purposes, this approach is unnecessarily contrived.This situation is very unfortunate, because other modern programming languages like C++ or Java, which are in other ways inferior to Ada, have a much more powerful exception mechanism.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call