comp.lang.ada
 help / color / mirror / Atom feed
From: bobduff@world.std.com (Robert A Duff)
Subject: Re: Using the GNAT defined attribute: 'Enum_Rep
Date: 1997/09/08
Date: 1997-09-08T00:00:00+00:00	[thread overview]
Message-ID: <EG7Enp.3DF@world.std.com> (raw)
In-Reply-To: 340D6C5D.2E53@pseserv3.fw.hac.com


In article <340D6C5D.2E53@pseserv3.fw.hac.com>,
W. Wesley Groleau x4923 <wwgrol@pseserv3.fw.hac.com> wrote:
>...  And in Ada 83, the above 
>would not be legal because 'Size is _defined_ as non-static, thus 
>can't be used to specify another 'Size.

S'Size is static if S is a static subtype (in both Ada 83 and 95).

>>      'Pos and 'Val. ... will work If and only if the representation is
>>     identical to the position numbers - what you get if you don't
>>     specify a representation. ....
>
>Is this true ?

Yes.

>...  Seems to me it's legal (though I've never seen
>it happen) for an implementation to generate anything it wanted
>for a representation as long as ordering, indexing, etc. worked.

Yes, but 'Pos and 'Val still need to return what the RM says, which is
*not* based on the representation.

>I can imagine a CPU where a bit per value is more efficient, i.e., 
>an implicit
>
>   for Enum use ( 0, 1, 2, 4, 8, 16, 32, ... );

Fine, but the 'Pos values are still 0, 1, 2, 3, ...

>though, again, I've never seen that done.

Me neither.  We probably never will, either.

- Bob




  parent reply	other threads:[~1997-09-08  0:00 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-08-27  0:00 Using the GNAT defined attribute: 'Enum_Rep Marin David Condic, 561.796.8997, M/S 731-96
1997-09-03  0:00 ` W. Wesley Groleau x4923
1997-09-06  0:00   ` Robert Dewar
1997-09-08  0:00     ` W. Wesley Groleau x4923
1997-09-08  0:00       ` Matthew Heaney
1997-09-08  0:00     ` Robert A Duff
1997-09-08  0:00   ` Robert A Duff [this message]
1997-09-08  0:00     ` W. Wesley Groleau x4923
1997-09-08  0:00       ` Matthew Heaney
1997-09-09  0:00         ` Robert A Duff
1997-09-11  0:00           ` Robert Dewar
1997-09-08  0:00 ` Robert A Duff
  -- strict thread matches above, loose matches on Subject: below --
1997-09-09  0:00 Marin David Condic, 561.796.8997, M/S 731-96
1997-09-09  0:00 ` W. Wesley Groleau x4923
1997-09-11  0:00   ` Robert Dewar
1997-09-09  0:00 Marin David Condic, 561.796.8997, M/S 731-96
1997-09-09  0:00 ` Robert A Duff
replies disabled

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