comp.lang.ada
 help / color / mirror / Atom feed
From: seas.gwu.edu!mfeldman@uunet.uu.net  (Michael Feldman)
Subject: Re: Enumerations
Date: 18 Sep 92 01:39:19 GMT	[thread overview]
Message-ID: <1992Sep18.013919.23204@seas.gwu.edu> (raw)

In article <1992Sep17.234026.27654@beaver.cs.washington.edu> simonson@cs.washin
gton.edu (Kevin Simonson) writes:
>
[stuff deleted]
>=
>="The position number of the value of the first listed enumeration literal is
>=zero" LRM 3.5.1(4). 
>
>     I was of the impression that the "position number" 3.5.1(4) referred
>to was the value returned by the "'pos" attribute, and that that value
>could be very different from the "machine value" that Crispen seems to be
>talking about.  I'm not convinced we've found an answer to his question
>yet.

No we haven't. The position number is _not_ the same as the machine value.
I have tried this on every compiler I have access to (about a dozen of
different makes and models), and not found any in which the machine
values are not 0,1,...This is not required by the LRM, but I find myself
wondering why an implementer would do it differently. It's so _easy_
this way.

I will post a little tricky program to play with stuff like this.
The only way I've found to learn the machine values (other than
the documentation), is to do an unchecked conversion to integer,
then display the value in binary or hex, and stare at it.

Mike Feldman 
------------------------------------------------------------------------
Michael B. Feldman
co-chair, SIGAda Education Committee

Professor, Dept. of Electrical Engineering and Computer Science
School of Engineering and Applied Science
The George Washington University
Washington, DC 20052 USA
(202) 994-5253 (voice)
(202) 994-5296 (fax)
mfeldman@seas.gwu.edu (Internet)

"Americans wants the fruits of patience -- and they want them now."
------------------------------------------------------------------------
>
>                                     ---Kevin Simonson

             reply	other threads:[~1992-09-18  1:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1992-09-18  1:39 Michael Feldman [this message]
  -- strict thread matches above, loose matches on Subject: below --
1992-09-22 14:27 Enumerations Chris Elliott
1992-09-20 22:32 Enumerations Gary Morris @pulsar
1992-09-19  2:31 Enumerations Michael Feldman
1992-09-19  1:18 Enumerations Mark A Biggar
1992-09-19  0:40 Enumerations John Goodenough
1992-09-18 17:54 Enumerations Michael Feldman
1992-09-18 15:41 Enumerations Mark A Biggar
1992-09-17 23:40 Enumerations Kevin Simonson
1992-09-17 22:26 Enumerations Darren Davenport 283-4173
1992-09-17 21:20 Enumerations david.c.willett
replies disabled

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