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=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,8623fab5750cd6aa X-Google-Attributes: gid103376,public Path: g2news1.google.com!news2.google.com!proxad.net!usenet-fr.net!enst.fr!melchior!cuivre.fr.eu.org!melchior.frmug.org!not-for-mail From: "Alexander E. Kopilovich" Newsgroups: comp.lang.ada Subject: Re: Enum'Image (Was: Improving Ada's image) Date: Wed, 23 Jun 2004 19:42:28 +0400 (MSD) Organization: Cuivre, Argent, Or Message-ID: References: NNTP-Posting-Host: lovelace.ada-france.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: melchior.cuivre.fr.eu.org 1088005292 27774 212.85.156.195 (23 Jun 2004 15:41:32 GMT) X-Complaints-To: usenet@melchior.cuivre.fr.eu.org NNTP-Posting-Date: Wed, 23 Jun 2004 15:41:32 +0000 (UTC) To: comp.lang.ada@ada-france.org Return-Path: In-Reply-To: ; from "Jacob Sparre A." at 22 Jun 2004 23:38:19 +0200 X-Mailer: Mail/@ [v2.44 MSDOS] X-Virus-Scanned: by amavisd-new-20030616-p7 (Debian) at ada-france.org X-BeenThere: comp.lang.ada@ada-france.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Gateway to the comp.lang.ada Usenet newsgroup" List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: g2news1.google.com comp.lang.ada:1812 Date: 2004-06-23T19:42:28+04:00 Jacob Sparre Andersen wrote: > > Enum'Image(My_Variable, Verbatim) > > Why not also allow "Upper_Case" and "Lower_Case"? Because you always can do these conversions later in your code. Providing all those translations in any form (attribute, "for ... use" clause or pragma) is just a redundant feature, perhaps convenient for some relatively rare programs but nothing more than that. But Verbatim case is different - you can't restore by you code an information that is already lost; so this Verbatim just prevent loss of information, which was present in the source code. But even the possibility of Verbatim seems somehow doubtful because it will slightly violate the rule of case insensitivity for names in Ada programs. That is, with this Verbatim option the behaviour of a program can depend on the case of the letters used inside the names in enums. One can argue that those names in enums resemble literals and therefore the case insensitivity rule should not be applied to them, but this is a problematic issue, I think. And anyway, it may be practically impossible for some compilers: if a compiler currently translate identifiers (including those from enums) before storing them in the symbol table then it probably would be not a small pain to change that tactics. Alexander Kopilovich aek@vib.usr.pu.ru Saint-Petersburg Russia