comp.lang.ada
 help / color / mirror / Atom feed
* Need for enumeration values
@ 1989-01-23 16:08 rracine
  0 siblings, 0 replies; only message in thread
From: rracine @ 1989-01-23 16:08 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1989-01-23 16:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1989-01-23 16:08 Need for enumeration values rracine

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox