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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d0452dbe16ac0df4 X-Google-Attributes: gid103376,public From: Stephen Leake Subject: Re: ObjectAda vs Gnat -- bugs Date: 1997/05/23 Message-ID: <3385E9F1.2915@gsfc.nasa.gov>#1/1 X-Deja-AN: 243407501 References: Organization: NASA Goddard Space Flight Center -- Greenbelt, Maryland USA Reply-To: Stephen.Leake@gsfc.nasa.gov Newsgroups: comp.lang.ada Date: 1997-05-23T00:00:00+00:00 List-Id: Robert A Duff wrote: > > Keith Thompson wrote: > >... > >So, it is legal in Ada 95 (but illegal in Ada 83) to use an object > >renaming declaration to rename an enumeration literal. > > Ah, at least *somebody* knows the right answer. ;-) > > It seems to me that when so many people get the *wrong* answer (see > below) ... As one of the people who gave a wrong answer, perhaps I can contribute (hopefully in a positive way :) > When so many are wrong, including at least one compiler writer, it's > probably a problem with the language, not with all those people. The > problem here, I think, is that enumeration literals are functions, in > Ada, which is completely weird, given that string_literals and > numeric_literals and null literals are just values. Nope. My problem is that I knew the Ada 83 rule about enumeration literals being functions, but missed the added capability of Ada 95 to treat function results as objects (which was precisely GNAT's problem). I've read Cohen's book, but either this particular issue isn't covered, or I forgot it. I haven't read the whole rationale yet. This is one reason why it is important to give references (to the reference manual, and/or the rationale) when you say "Ada 95 lets you do X". Those of us still learning need to go read the RM, to get more familiar with it. Or provide a reference to a popular book. I guess I should have qualified my post with "unless there's something in Ada 95 I've missed" :) -- - Stephe