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,ca9eef4d5e2078ea X-Google-Attributes: gid103376,public From: mheaney@ni.net (Matthew Heaney) Subject: Re: Beware: Rep spec on an enumeration type causes code explosion Date: 1997/12/06 Message-ID: #1/1 X-Deja-AN: 295824983 References: Organization: Estormza Software Newsgroups: comp.lang.ada Date: 1997-12-06T00:00:00+00:00 List-Id: In article , dewar@merv.cs.nyu.edu (Robert Dewar) wrote: >There is actually a very important implementation dependent decision >to be made here, for which the RM gives no hint of a desirable decision, >or even a recognition that there *is* an implementation dependence here. >And that is whether to index the array by pos or rep values. To index >by pos values means that the array type x has size 12 bytes (assuming >4 byte integers), and to index by rep values, means that it has size >40 bytes (i.e. room for 10 integers with holes). The "recognition of an implementation dependence" does appear in the Ada 83 Rationale. Section 15.5, Enumeration Types with Noncontiguous Representations, discusses the issues Robert alluded to in his post. Indeed, the implementation techniques Robert proffered are in there too. Every Ada programmer should read the Ada 83 Rationale, as it provides lots of cool insight into the language. -------------------------------------------------------------------- Matthew Heaney Software Development Consultant (818) 985-1271