comp.lang.ada
 help / color / mirror / Atom feed
From: Keith Thompson <kst@cts.com>
Subject: Re: Enumeration representation
Date: 1999/09/13
Date: 1999-09-13T00:00:00+00:00	[thread overview]
Message-ID: <yec7llus8yw.fsf@king.cts.com> (raw)
In-Reply-To: 7rjn38$7e1$1@nnrp1.deja.com

Robert Dewar <robert_dewar@my-deja.com> writes:
> You look and see whether it is signed!!!
> 
> If you insist on not knowing it is harder.
> 
> It is even harder if you insist on handcuffing yourself
> and typing with your nose :-)
> 
> In a real situation, you know what type you are dealing with
> and the section of code that has the enum type can export the
> corresponding integral type and indeed the routine for doing
> the conversion!

What if the type is declared in code over which you have no control?
Yes, you can probably look at the source code, but it could change in
the next release.  For that matter, what if it's a generic formal
parameter?

If this feature had been better designed (IMHO), it would be possible
to get at the internal representation in a way that won't break if the
type or the representation is changed -- just recompile and it works.

I think we're all agreed on the proper solution: avoid enumeration
representation clauses whenever possible.

I gotta try that handcuff thing some time!

-- 
Keith Thompson (The_Other_Keith) kst@cts.com  <http://www.ghoti.net/~kst>
San Diego Supercomputer Center           <*>  <http://www.sdsc.edu/~kst>
"Oh my gosh!  You are SO ahead of your time!" -- anon.




  parent reply	other threads:[~1999-09-13  0:00 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-09-10  0:00 Enumeration representation Alex
1999-09-10  0:00 ` Ted Dennison
1999-09-10  0:00   ` Robert Dewar
1999-09-13  0:00     ` Ted Dennison
1999-09-10  0:00 ` David C. Hoos, Sr.
1999-09-10  0:00   ` Robert Dewar
1999-09-10  0:00 ` Keith Thompson
1999-09-11  0:00   ` Robert Dewar
1999-09-11  0:00     ` Keith Thompson
1999-09-12  0:00       ` Bryce Bardin
1999-09-13  0:00         ` Robert Dewar
1999-09-13  0:00           ` Keith Thompson
1999-09-13  0:00       ` Robert Dewar
1999-09-12  0:00         ` Keith Thompson
1999-09-13  0:00           ` Robert Dewar
1999-09-13  0:00             ` Ted Dennison
1999-09-13  0:00             ` Keith Thompson [this message]
1999-09-14  0:00               ` Robert Dewar
1999-09-13  0:00         ` Robert A Duff
1999-09-13  0:00           ` Robert Dewar
1999-09-10  0:00 ` Matthew Heaney
1999-09-10  0:00   ` Robert Dewar
1999-09-13  0:00 ` Alex
  -- strict thread matches above, loose matches on Subject: below --
2004-01-01 20:44 Luke A. Guest
2004-01-01 21:45 ` Stephen Leake
2004-01-01 22:01   ` Luke A. Guest
2004-01-02  1:17     ` tmoran
2004-01-02  1:29     ` Stephen Leake
2004-01-02  3:10       ` Luke A. Guest
2004-01-02  2:46 ` Robert A Duff
2004-01-02  3:12   ` Luke A. Guest
2004-01-02 13:58   ` Marin David Condic
2004-01-02 21:39     ` Pat Rogers
2004-01-03 13:42       ` Marin David Condic
2004-01-03  1:53     ` Robert A Duff
2004-01-02 20:52   ` Randy Brukardt
2004-01-02 21:05     ` Luke A. Guest
replies disabled

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