From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 18 Sep 92 01:39:19 GMT From: seas.gwu.edu!mfeldman@uunet.uu.net (Michael Feldman) Subject: Re: Enumerations Message-ID: <1992Sep18.013919.23204@seas.gwu.edu> List-Id: 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