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.9 required=5.0 tests=BAYES_00 autolearn=ham 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!news.tele.dk!news.tele.dk!small.news.tele.dk!news2.telebyte.nl!news.jgaa.com!news.hacking.dk!pnx.dk!munin.nbi.dk!not-for-mail From: Jacob Sparre Andersen Newsgroups: comp.lang.ada Subject: Re: Enum'Image (Was: Improving Ada's image) Date: 22 Jun 2004 23:38:19 +0200 Organization: Munin Sender: sparre@sparre.crs4.it Message-ID: References: NNTP-Posting-Host: 80.241.165.38 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: munin.nbi.dk 1087940302 6615 80.241.165.38 (22 Jun 2004 21:38:22 GMT) X-Complaints-To: sparre@munin.nbi.dk NNTP-Posting-Date: Tue, 22 Jun 2004 21:38:22 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: g2news1.google.com comp.lang.ada:1793 Date: 2004-06-22T23:38:19+02:00 List-Id: Alexander E. Kopilovich wrote: > Adrian Wrigley wrote: > > Something to say "use the names spelled as I spell them" is > > needed. Good point. > Perhaps the best solution would be to add second argument to Image > attribute, with the sngle possible value Verbatim. That is, you'll > write > > Enum'Image(My_Variable, Verbatim) Why not also allow "Upper_Case" and "Lower_Case"? The problem with this compared to a representation clause (whether common for the enumeration type or on a per item basis) is that it will complicate the Enum'Image function. I don't know if it is an acceptable complication or not. > If you do not use that second argument then the Image attribute acts > with the default (currently standard) way; I don't think that > additional values for that second argument - Upper, Lower, etc, will > be good things - I believe that in those cases explicit translation > by a function call is better than loading the attribute with excess > functionality. Once you have added an extra Enum'Image function, I don't think _also_ adding a lower case version is a big deal. Using Adrian Wrigley's suggestion, but keeping the view that it is a representation issue, it could be done with: for Enumeration_Type'Image use (Verbatim|Upper_Case|Lower_Case); and optionally in addition with: for Enumeration_Literal'Image use string_constant; for individual enumeration_literals of the enumeration_type. Jacob -- "There is a slight error in the exponent" - quantum vaacum mass is 10^35 times the total dark matter mass