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: Fri, 10 Dec 2004 21:18:06 GMT
Date: 2004-12-10T21:18:06+00:00	[thread overview]
Message-ID: <lnpt1hdfg6.fsf@nuthaus.mib.org> (raw)
In-Reply-To: vtKdnSCJUc9uZiTcRVn-ow@megapath.net

[...]
> 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.

The 'Pos and 'Val attributes deal with the position number, and for
loops iterate over the defined values.  That's fine.  But why make the
programmer jump through so many hoops to deal with the representation
values?

The fact that GNAT has the 'Enum_Rep attribute is evidence (but not
proof) that there's a need for this kind of thing.

I've implemented enumeration representation clauses, but I've never
found them to be useful.

-- 
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-10 21:18 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 [this message]
2004-12-11  0:53                     ` Keith Thompson
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