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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,227757d168eaa8a5 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!newshub.sdsu.edu!elnk-nf2-pas!elnk-pas-nf1!newsfeed.earthlink.net!cyclone.socal.rr.com!cyclone2.kc.rr.com!news2.kc.rr.com!twister.socal.rr.com.POSTED!53ab2750!not-for-mail Newsgroups: comp.lang.ada Subject: Re: A question re meaning/use of the "for ... use ..." References: <41b3291e$0$44072$5fc3050@dreader2.news.tiscali.nl> From: Keith Thompson Message-ID: User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) Cancel-Lock: sha1:76dBPvQtkn3/WrZC7y1gzKjbJ4Y= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 11 Dec 2004 00:53:03 GMT NNTP-Posting-Host: 66.91.240.168 X-Complaints-To: abuse@rr.com X-Trace: twister.socal.rr.com 1102726383 66.91.240.168 (Fri, 10 Dec 2004 16:53:03 PST) NNTP-Posting-Date: Fri, 10 Dec 2004 16:53:03 PST Organization: RoadRunner - West Xref: g2news1.google.com comp.lang.ada:6890 Date: 2004-12-11T00:53:03+00:00 List-Id: Keith Thompson writes: > [...] >> But this whole issue comes from people trying to use enumeration >> representations for purposes for which they are not intended. They're only >> intended to be used for *external* representations, which means that the >> program itself has no reason to be concerned with them. The program should >> use the internal representation. > [...] > > People use things for purposes for which they are not intended all the > time. Ada quite properly makes it easiest to use things in the way > they're intended, but in this case, in my opinion, it goes too far in > preventing the programmer from doing certain things. I thought of another point after I posted this. If I specify the address of an object: for Obj'Address use ...; I can query the address with the Address attribute. Likewise for the Size attribute. I can even query the layout of a record using the Position, First_Bit, and Last_Bit attributes. Arguably the program shouldn't be concerned with these things, but the attributes are available. Given this, the lack of an attribute that lets me query the representation of an enumeration value seems odd. -- Keith Thompson (The_Other_Keith) kst-u@mib.org San Diego Supercomputer Center <*> We must do something. This is something. Therefore, we must do this.