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/08 Message-ID: #1/1 X-Deja-AN: 270772351 References: <97082719523509@psavax.pwfl.com> <340D6C5D.2E53@pseserv3.fw.hac.com> Organization: The World Public Access UNIX, Brookline, MA Newsgroups: comp.lang.ada Date: 1997-09-08T00:00:00+00:00 List-Id: In article <340D6C5D.2E53@pseserv3.fw.hac.com>, W. Wesley Groleau x4923 wrote: >... And in Ada 83, the above >would not be legal because 'Size is _defined_ as non-static, thus >can't be used to specify another 'Size. S'Size is static if S is a static subtype (in both Ada 83 and 95). >> 'Pos and 'Val. ... will work If and only if the representation is >> identical to the position numbers - what you get if you don't >> specify a representation. .... > >Is this true ? Yes. >... Seems to me it's legal (though I've never seen >it happen) for an implementation to generate anything it wanted >for a representation as long as ordering, indexing, etc. worked. Yes, but 'Pos and 'Val still need to return what the RM says, which is *not* based on the representation. >I can imagine a CPU where a bit per value is more efficient, i.e., >an implicit > > for Enum use ( 0, 1, 2, 4, 8, 16, 32, ... ); Fine, but the 'Pos values are still 0, 1, 2, 3, ... >though, again, I've never seen that done. Me neither. We probably never will, either. - Bob