comp.lang.ada
 help / color / mirror / Atom feed
From: bobduff@world.std.com (Robert A Duff)
Subject: Re: Using the GNAT defined attribute: 'Enum_Rep
Date: 1997/09/09
Date: 1997-09-09T00:00:00+00:00	[thread overview]
Message-ID: <EG9JGC.6vs@world.std.com> (raw)
In-Reply-To: 97090911205153@psavax.pwfl.com


In article <97090911205153@psavax.pwfl.com>,
Marin David Condic, 561.796.8997, M/S 731-96 <condicma@PWFL.COM> wrote:
>    Still, it would be very useful to have an attribute that is the
>    inverse of 'Enum_Rep, taking a universal integer parameter and
>    returning the corresponding enumeral - raising Constraint_Error if
>    the integer did not match an enumeral internal representation.

The Ada 9X team proposed a 'Rep attribute along these lines, but it was
nixed.  After all, doesn't U_C do the same?  (Now where's that smily
Robert recently asked about, which denotes sarcasm?  OTOH, Mark Twain,
who is probably the most sarcastic person ever born, never seemed to
need a mark to denote sarcasm.  OTTH, he didn't use smilies in his funny
stuff, either.)

>... (Or
>    possibly not raising the exception? Let it work a little like
>    Unchecked_Conversion?)

No, such an attribute ought to do the check.  With U_C, one needs to
check beforehand.

- Bob




  reply	other threads:[~1997-09-09  0:00 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-09-09  0:00 Using the GNAT defined attribute: 'Enum_Rep Marin David Condic, 561.796.8997, M/S 731-96
1997-09-09  0:00 ` Robert A Duff [this message]
  -- strict thread matches above, loose matches on Subject: below --
1997-09-09  0:00 Marin David Condic, 561.796.8997, M/S 731-96
1997-09-09  0:00 ` W. Wesley Groleau x4923
1997-09-11  0:00   ` Robert Dewar
1997-08-27  0:00 Marin David Condic, 561.796.8997, M/S 731-96
1997-09-03  0:00 ` W. Wesley Groleau x4923
1997-09-06  0:00   ` Robert Dewar
1997-09-08  0:00     ` Robert A Duff
1997-09-08  0:00     ` W. Wesley Groleau x4923
1997-09-08  0:00       ` Matthew Heaney
1997-09-08  0:00   ` Robert A Duff
1997-09-08  0:00     ` W. Wesley Groleau x4923
1997-09-08  0:00       ` Matthew Heaney
1997-09-09  0:00         ` Robert A Duff
1997-09-11  0:00           ` Robert Dewar
1997-09-08  0:00 ` Robert A Duff
replies disabled

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