comp.lang.ada
 help / color / mirror / Atom feed
From: arny@wayback.UUCP (Arny B. Engelson)
Subject: Re: enumeration literal/internal codes query
Date: 10 Jan 89 23:15:41 GMT	[thread overview]
Message-ID: <1499@wayback.UUCP> (raw)
In-Reply-To: 1494@wayback.UUCP

In article <1494@wayback.UUCP>, arny@wayback.UUCP (Arny B. Engelson) writes:
> Here's the question:
>    After specifying internal codes for the literals of an enumeration type
>    using an enumeration representation clause, how do you (later in the
>    code) find out what internal codes were specified?
> 
>    Note that this question actually is the same whether or not an
>    enumeration rep clause is used.  How do you find out the internal codes?
> 
> Arny Engelson    (att,ihnp4,clyde)!wayback!arny    (201) 386-4816

After receiving 3 misguided, but well intended, responses (in one day)
suggesting I use the 'POS attribute, I thought I'd clarify my question.

'POS gives the position number, which always starts at 0 (RM 3.5.1),
and increments by 1 for each successor.  This has NOTHING TO DO with
the internal codes specified in an enumeration representation clause.

Also, I know Unchecked_Conversion can be used (by converting to an integer
type of the appropriate size), but this is extremely messy
(repeated instantiations for each enumeration type to be converted), and
not at all what I had in mind.  There should be a better way.

It seems to me that retrieving the internal codes being used to store an
object, whether specified by the programmer or assigned by the
implementation, should be provided for directly by a language feature
(such as an attribute).

Any comments from members of the ALIWG, members of the language maintenance
committee (or whatever it's called these days), or anyone else, are welcome.


  - Arny Engelson

  reply	other threads:[~1989-01-10 23:15 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1989-01-09 15:25 enumeration literal/internal codes query Arny B. Engelson
1989-01-10 23:15 ` Arny B. Engelson [this message]
1989-01-13 17:03   ` Scott Moody
1989-01-16 18:03     ` Badger BA 64810
1989-01-19 19:44       ` Scott Moody
1989-01-31 18:05         ` Arny B. Engelson
1989-01-15  4:42   ` John Goodenough
1989-01-12  0:31 ` Michael Murphy
1989-01-12 15:51 ` enumeration literal/internal codes stt
1989-01-20 15:04 ` ryer
  -- strict thread matches above, loose matches on Subject: below --
1989-01-13 21:29 enumeration literal/internal codes query rracine
replies disabled

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