comp.lang.ada
 help / color / mirror / Atom feed
From: Keith Thompson <kst-u@mib.org>
Subject: Re: A question re meaning/use of the "for ... use ..."
Date: Sat, 11 Dec 2004 00:53:03 GMT
Date: 2004-12-11T00:53:03+00:00	[thread overview]
Message-ID: <lnis79bqxi.fsf@nuthaus.mib.org> (raw)
In-Reply-To: lnpt1hdfg6.fsf@nuthaus.mib.org

Keith Thompson <kst-u@mib.org> 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  <http://www.ghoti.net/~kst>
San Diego Supercomputer Center             <*>  <http://users.sdsc.edu/~kst>
We must do something.  This is something.  Therefore, we must do this.



  reply	other threads:[~2004-12-11  0:53 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-05 15:27 A question re meaning/use of the "for ... use ..." Erik J Pessers
2004-12-05 15:47 ` Martin Krischik
2004-12-05 15:59 ` Stephen Leake
2004-12-05 16:52   ` Jeffrey Carter
2004-12-06 19:59     ` Randy Brukardt
2004-12-07  1:36       ` Jeffrey Carter
2004-12-07  2:40         ` David C. Hoos, Sr.
2004-12-07 20:59         ` Randy Brukardt
2004-12-08  1:41           ` Jeffrey Carter
2004-12-08  8:40           ` Martin Dowie
2004-12-08 16:23             ` Georg Bauhaus
2004-12-08  3:18       ` Keith Thompson
2004-12-08 13:48         ` David C. Hoos
2004-12-08 19:50         ` Randy Brukardt
2004-12-08 23:00           ` Keith Thompson
2004-12-09 23:06             ` Randy Brukardt
2004-12-10  2:26               ` Keith Thompson
2004-12-10 19:42                 ` Randy Brukardt
2004-12-10 21:18                   ` Keith Thompson
2004-12-11  0:53                     ` Keith Thompson [this message]
2004-12-10  3:13             ` David C. Hoos
2004-12-10  9:23               ` Keith Thompson
2004-12-10 13:24                 ` David C. Hoos
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox