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,45a9122ddf5fcf5 X-Google-Attributes: gid103376,public From: kst@thomsoft.com (Keith Thompson) Subject: Re: Valid Attribute and Unchecked Conversion Date: 1996/10/06 Message-ID: #1/1 X-Deja-AN: 187919061 sender: news@thomsoft.com (USENET News Admin @flash) x-nntp-posting-host: pulsar references: organization: Thomson Software Products, San Diego, CA, USA newsgroups: comp.lang.ada originator: kst@pulsar Date: 1996-10-06T00:00:00+00:00 List-Id: In bobduff@world.std.com (Robert A Duff) writes: [...] > They shouldn't be, because, as you explained, they don't work. Using > sparse enums is asking for erroneousness. [...] > The whole feature causes an awful lot of complexity in compilers, > given that it's not very useful. Sigh. Especially since it wouldn't have been difficult to make them useful. The root of the problem, I think, is Ada 83's emphasis (not entirely successful) on guaranteeing that representation clauses affect only representation, not semantics. In the case of enumeration types, this was carried just a little too far, IMHO. For example, the language could have defined two additional attributes, analagous to 'Pos and 'Val, but operating on the internal representation of an enumeration type. If the argument is an invalid representation, simply raise Constraint_Error. GNAT provides half of this with its 'Enum_Rep attribute. -- Keith Thompson (The_Other_Keith) kst@thomsoft.com <*> TeleSoft^H^H^H^H^H^H^H^H Alsys^H^H^H^H^H Thomson Software Products 10251 Vista Sorrento Parkway, Suite 300, San Diego, CA, USA, 92121-2706 FIJAGDWOL