From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,514627f9964b6e38 X-Google-Attributes: gid103376,public From: bobduff@world.std.com (Robert A Duff) Subject: Re: Using the GNAT defined attribute: 'Enum_Rep Date: 1997/09/09 Message-ID: #1/1 X-Deja-AN: 271086607 References: <97090911205153@psavax.pwfl.com> Organization: The World Public Access UNIX, Brookline, MA Newsgroups: comp.lang.ada Date: 1997-09-09T00:00:00+00:00 List-Id: In article <97090911205153@psavax.pwfl.com>, Marin David Condic, 561.796.8997, M/S 731-96 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