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,df854b5838c3e14 X-Google-Attributes: gid103376,public From: eachus@spectre.mitre.org (Robert I. Eachus) Subject: Re: C/C++ knocks the .... Date: 1996/02/23 Message-ID: #1/1 X-Deja-AN: 140855712 references: <4g2r2r$ded@stc06.ctd.ornl.gov> organization: The Mitre Corp., Bedford, MA. newsgroups: comp.lang.ada Date: 1996-02-23T00:00:00+00:00 List-Id: In article bobduff@world.std.com (Robert A Duff) writes: > And it's an annoyance to compiler writer's, too. Consider: > X: Character := Character'('z'); > where the string > '(' > is *not* a character literal. > Not a huge implementation problem, but still an annoyance. Once upon a time it was a huge implementation problem. In Green and, I think, Ada 80, there was no distiction between a type conversion and a qualified expression. When the syntax was first changed to use the ' for qualified expressions, there were cases where you had to do arbitrary lookahead to determine whether or not the first ' started a character literal or an attribute. A'B'('"','A','B','C',... is the canononical "horrible" case. In theory these cases still exist, but no compiler author is that dumb. You would have to have an implementation defined attribute with a single character name, and that attribute would have to name a subtype. Anyway, once there was a draft version of the RM where the rule was that "an apostrophe following a name never begins a character literal," that rule became sacrosanct, and the tricky stuff in the scanner was only used for error correction. -- Robert I. Eachus with Standard_Disclaimer; use Standard_Disclaimer; function Message (Text: in Clever_Ideas) return Better_Ideas is...