From: Stephen Leake <stephen_leake@acm.org>
To: comp.lang.ada@ada-france.org
Subject: Re: Accessing the underlying rep for enumerated types?
Date: 13 Oct 2004 08:29:55 -0400
Date: 2004-10-13T08:29:55-04:00 [thread overview]
Message-ID: <mailman.305.1097670614.390.comp.lang.ada@ada-france.org> (raw)
In-Reply-To: <MrNoSpam-2408AC.16521913102004@news-server.bigpond.net.au>
Dale Stanbrough <MrNoSpam@bigpoop.net.au> writes:
> Stephen Leake wrote:
>
> > Dale Stanbrough <MrNoSpam@bigpoop.net.au> writes:
> >
> > > An enumeration type can have a representation clause applied to it
> > > allowing you to specify a underlying integer representation for
> > > each value.
> > >
> > > 'Pos tells you the position within the enumeration, not it's
> > > underlying value. Is there any way to get access to this value
> > > other than using Unchecked_Conversion?
> >
> > No.
> >
> > This is (unfortunately) a FAQ.
> >
> > What's wrong with Unchecked_Conversion?
>
> There's nothing wrong with it.
Then why ask this question?
> > And why do you want to expose the underlying representation?
>
> So I can show people how holey enumeration types can be expensive.
Ah, I forgot you are a teacher (or do you prefer 'professor'?).
So use Unchecked_Conversion!
--
-- Stephe
next prev parent reply other threads:[~2004-10-13 12:29 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-12 22:32 Accessing the underlying rep for enumerated types? Dale Stanbrough
2004-10-13 0:20 ` Stephen Leake
[not found] ` <MrNoSpam-2408AC.16521913102004@news-server.bigpond.net.au>
2004-10-13 7:23 ` Marius Amado Alves
2004-10-13 12:29 ` Stephen Leake [this message]
2004-10-13 1:26 ` Jeffrey Carter
2004-10-13 6:51 ` Dale Stanbrough
2004-10-13 21:49 ` Nick Roberts
2004-10-14 1:25 ` Jeffrey Carter
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox