[comp.lang.ada] Need for enumeration values

rracine@AJPO.SEI.CMU.EDU (01/24/89)

The one time we would have liked the enumeration values in a type which
had a representation clause was in a communication subsystem.  The 
programmer thought she could use the attributes to change the type into
a numeric type for transmission.  Then, on the other side, she used
UNCHECKED_CONVERSION for changing it back.  Needless to say, it did not
work.  When I was consulted, it took a while for me to find the misuse
of the attribute.  All in all, it probably cost about one person-day to
solve.

To turn the question around, is there any need for the POS attribute to
work as it does?  Has anyone used it such that if the attribute gave the
actual value it would have been wrong?

By the way, I checked three Ada books to see what they say about the POS
attribute.  The LRM was the most clear (IF one looked in chapter 13).
The two other books (which are much more likely to be read than the LRM)
were vague enough that they probably would not need to be rewritten if the
definition changed.  However, the LRM would have to be changed in at least
three places.  A different attribute would need to be mentioned everywhere
POS is mentioned (along with its inverse).

Roger Racine
C.S. Draper Laboratory, Inc.
rjr1287@draper.com
(617) 258-2489