Rationale for Ada 2005
6.1 Ada Issues: Exceptions, generics, etc
The areas mentioned in this chapter are not specifically
mentioned in the WG9 guidance document
[1]
other than under the request to remedy shortcomings and improve interfacing.
The following Ada Issues
cover the relevant changes and are described in detail in this chapter.
Preelaborable initialization
Unchecked unions – variants without discriminant
pragma Unsuppress
Testing for null occurrence
Abstract interfaces to provide multiple inheritance
Restrictions for implementation defined entities
Abstract formal subprograms & dispatching constructors
Fast float to integer conversion
Assert pragma
Partial parameter lists for formal packages
pragma No_Return – procedures that never return
Mod attribute
Raise with message
Fixed point multiply and divide
Restrictions for obsolescent features
New Restrictions identifier – No_Dependence
Redundant Restrictions identifiers and Ravenscar
Parameters of formal packages given at most once
Wide and wide-wide images
pragma No_Return for overriding procedures
Lower bound of functions in Ada.Exceptions
etc
Limitedness of derived types
Resolution of universal operations in Standard
Renaming, null exclusion and formal objects
These changes can be grouped as follows.
First there are some minor changes to exception handling.
There are neater means for testing for null occurrence and raising an
exception with a message (
241,
361)
and also wide and wide-wide versions of some procedures (
400,
417).
The numerics area has a number of small but important
changes. They are the introduction of an attribute
Mod
to aid conversion between signed and unsigned integers (
340);
changes to the rules for fixed point multiplication and division which
permit user-defined operations (
364,
420);
and an attribute
Machine_Rounding which can
be used to aid fast conversions from floating to integer types (
267).
A number of new pragmas and
Restrictions
identifiers have been added. These generally make for more reliable programming.
The pragmas are:
Assert,
No_Return,
Preelaborable_Initialization,
Unchecked_Union,
and
Unsuppress (
161,
216,
224,
286,
329,
414).
The restrictions identifiers are
No_Dependence,
No_Implementation_Pragmas,
No_Implementation_Restrictions,
and
No_Obsolescent_Features (
257,
368,
381).
Note that there are also other new pragmas and new restrictions identifiers
concerned with tasking as described in the previous chapter (see
5.4).
However, the introduction of
No_Dependence
means that the identifiers
No_Asynchronous_Control,
No_Unchecked_Conversion and
No_Unchecked_Deallocation
are now obsolescent (
394).
Finally there are changes in generic units. There
are changes in generic parameters which are consequences of changes in
other areas such as the introduction of interfaces and dispatching constructors
as described in the chapter on the object oriented model (parts of
251
and
260);
there are also changes to formal access and derived types (
419,
423).
Also, it is now possible to give just some parameters of a formal package
in the generic formal part (
317,
398).
© 2005, 2006 John Barnes Informatics.
Sponsored in part by: