Version 1.2 of ai05s/ai05-0004-1.txt

Unformatted version of ai05s/ai05-0004-1.txt version 1.2
Other versions for file ai05s/ai05-0004-1.txt

!standard 1.1.3 (17)          06-03-15 AI05-0004-1/00
!class presentation 06-03-15
!status received 06-03-15
!priority Low
!difficulty Easy
!qualifier Omission
!subject Presentation issues in the Standard.
!summary
This AI corrects minor errors in the Standard.
!question
[This is a placeholder for the certain flood of errors.]
!recommendation
(See summary.)
!wording
!discussion
!comment !corrigendum 1.1.3(17)
!ACATS test
None needed.
!appendix

From: Tucker Taft
Sent: Wednesday, April 12, 2006  12:48 PM

We have a relative newcomer to Ada doing some of
our Ada 2005 work, and it is useful because it forces
me to actually *read* what we have written in the
reference manual.  I came upon this wording in 4.6(24.*):

     If there is no type that is the ancestor of both
     the target type and the operand type, and they are
     not both class-wide types, one of the following
     rules shall apply:

       * If the target type is a numeric type, ...
       * If the target type is an array type, ...
       * If the target type is universal access, ...
       * If the target type is a general access...
       * If the target type is a pool-specific access...
       * If the target type is an access-to-subprogram...

In explaining this to our engineer, I found the introductory
paragraph to be a confusing way of putting things.  In our
next revision, I would suggest we reword the introductory
paragraph roughly as follows:

     If there is no type that is the ancestor of both
     the target type and the operand type, and they are
     not both class-wide types, then the target type
     shall be a numeric type, an array type, or
     an access type; further: ... [same bullets as before]

As introduced now, you have to read all of the following bullets
to figure out what kind of types *might* be covered by these
set of rules, and we are relying on the phrase
"one of the following shall apply" to effectively say that
record types do not allow conversions other than those
allowed for in 4.6(21-23.1).  And there are a lot of rules to
read (not just the six abstracted above), since most of the rules
have several sub-bullets.  For example, are all access types
(including anonymous ones) covered by at least one of the rules?
It takes some time to decide.  In general, as written the
introductory paragraph seems to put an undue and unnecessary
burden on the reader to decide whether exactly one of the rules
applies to any given situation.

For what it is worth, the specific case we wanted to know
about was conversion between an interface and a non-interface
type.  You can easily get lost in the long-winded rules
relating to access types and think that your case might
be covered.

****************************************************************


Questions? Ask the ACAA Technical Agent