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-Thread: 103376,545551cf46d41dea X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!feeder.news-service.com!feeder2.cambrium.nl!feeder1.cambrium.nl!feed.tweaknews.nl!proxad.net!newsfeed.arcor.de!news.arcor.de!not-for-mail Date: Wed, 02 Aug 2006 11:13:47 +0200 From: Georg Bauhaus Organization: elsewhere User-Agent: Thunderbird 1.5.0.5 (Macintosh/20060719) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: ICFP Programming Contest virtual machine in Ada References: <87zmeobwtd.fsf@willow.rfc1149.net> <1154465002.9271.1.camel@localhost.localdomain> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <44d06c5b$0$18518$9b4e6d93@newsread2.arcor-online.net> NNTP-Posting-Date: 02 Aug 2006 11:11:56 MEST NNTP-Posting-Host: 43544e78.newsread2.arcor-online.net X-Trace: DXC=a;R3MNn>YB5::C@ZGckeZ1Q5U85hF6f;4jW\KbG]kaM8AV6U:Z=fE=?RXf;QenT\C=PCY\c7>ejV8VIRd0J9Zda2 X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:6061 Date: 2006-08-02T11:11:56+02:00 List-Id: Javier Miranda wrote: > > On Aug 1, 2006, at 4:43 PM, Georg Bauhaus wrote: > >> Alas, this code cannot be compiled with a plain Ada compiler >> as it uses non-Ada 'Img (which is brief, though). > > Considering T the type of the object to which you apply this > attribute, this is a GNAT attribute that is equivalent to > T'Image (Obj). Yes, but 'Img was invented for quickly writing debugging expressions, IIRC, not for writing standard Ada expressions. It might be worth pointing out that T must be a scalar type. > For example, being V a variable containing an integer value, > instead of writing Integer'Image (V) you can just write V'Img. No, you can't write V'Img because 'Img is a GNAT implementation defined attribute ;-) For a standard Ada program, you must write Integer'Image(V). Pragma Extensions_Allowed(Off) does not seem to turn this 'Img extension of. Is there a switch to instruct gnatmake to warn about implementation defined attributes? Or more generally, something with an intent similar to -gnato, or -gnat83/95/05, that makes GNAT reject non-standard constructs? (I have found some advice in the GNAT documentation to not use implementation defined pragmas when portability is an issue; given the qualities of GNAT, I should think that it can categorize the pragmas found in source text, and inform about the result.) -- Georg