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=0.7 required=5.0 tests=BAYES_00,MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c6e6cdf6ff50e684 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-02-10 09:40:23 PST Path: supernews.google.com!sn-xit-02!supernews.com!nntp-relay.ihug.net!ihug.co.nz!newsfeed.yosemite.net!news-out.cwix.com!newsfeed.cwix.com!cpk-news-hub1.bbnplanet.com!news.gtei.net!nntp2.deja.com!nnrp1.deja.com!not-for-mail From: Robert Dewar Newsgroups: comp.lang.ada Subject: Re: Representation clause for enumeratives Date: Sat, 10 Feb 2001 17:29:06 GMT Organization: Deja.com Message-ID: <963tos$atu$1@nnrp1.deja.com> References: <95tqbh$ag7$1@nnrp1.deja.com> <962n4v$fmg$1@nnrp1.deja.com> <27eh6.3787$y03.254014@news.flash.net> NNTP-Posting-Host: 205.232.38.14 X-Article-Creation-Date: Sat Feb 10 17:29:06 2001 GMT X-Http-User-Agent: Mozilla/4.61 [en] (OS/2; U) X-Http-Proxy: 1.0 x65.deja.com:80 (Squid/1.1.22) for client 205.232.38.14 X-MyDeja-Info: XMYDJUIDrobert_dewar Xref: supernews.google.com comp.lang.ada:5103 Date: 2001-02-10T17:29:06+00:00 List-Id: In article <27eh6.3787$y03.254014@news.flash.net>, "Ken Garlington" wrote: > By the way, this description > of the shifting of the allowable range (selecting different > unbiased representations) would be very useful in the GNAT > user guide. I couldn't find it. Information on representation matters is really part of the language, and in particular is required to be documented by RM M(43). All such information is in the GNAT reference manual, not in the users guide (which is about how to use the compiler, rather than how to write programs). The divisision is not always perfectly clear, but in this case, there is a chapter called "Representation Clauses and Pragmas", which a section called "Enumeration Clauses", that contains this information as well as other important information. In particular, one very important item which is (very unfortunately) left implementation defined is what happens if you have an array whose index type is an enumeration type with holes. There are two implementations: 1. Use the representation to index, fast, but can waste space (a lot of space if you have a rep clause like the one that started this thread). 2. Use the pos value to index, slow, but compact GNAT chooses the second, mostly because Verdix chose the second, and we generally choose to be Verdix Ada 83 compatible in such matters (in this case, this is also the choice made by DEC Ada 83 and other Ada 83 compilers). Sent via Deja.com http://www.deja.com/