From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,3b24966551ccf2cd X-Google-Attributes: gid103376,public From: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: Enumerated types and attributes thereof? Date: 1998/04/18 Message-ID: #1/1 X-Deja-AN: 345257066 References: <3537A1F6.41C6@lmco.com> X-Complaints-To: usenet@news.nyu.edu X-Trace: news.nyu.edu 892873005 13159 (None) 128.122.140.58 Organization: New York University Newsgroups: comp.lang.ada Date: 1998-04-18T00:00:00+00:00 List-Id: Gerhard asks < TEST_TYPE'val(1) eval's to three. Incidentally <'pos> is screwy TEST_TYPE'pos(one) eval's to 0. I probably am asking a silly question... >> Well it is certainly a strange question, it is a bit like asking "How can I, without using the plus operator, add two floating-point numbers." Unchecked_Conversion is exactly the tool you need here, so why the reluctance to use it? As for screwy 'pos, anything can seem "screwy" if you do not know the language rules! The Pos attribute gives the zero origin position of the enumeration literal, since one is the first literal, it has the position number of zero. No one who has read the Ada RM (or for that matter any elementary Ada book) would expect anything else here!