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,826cd690cb6a7585 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!news4.google.com!feeder1-2.proxad.net!proxad.net!feeder2-2.proxad.net!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Wed, 31 Aug 2011 23:58:31 +0200 From: Georg Bauhaus User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:6.0) Gecko/20110812 Thunderbird/6.0 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: The simple Image issue References: <904e717e-da4c-46c9-bbc2-4bae8368d459@l4g2000vbv.googlegroups.com> <4e5d139f$0$6575$9b4e6d93@newsspool3.arcor-online.net> <3756bc0c-d938-4b45-baa1-b80e59d58055@a10g2000prn.googlegroups.com> <1a879va9fjuwo.1r1b6vbp45lx5.dlg@40tude.net> <4e5dd1c1$0$6638$9b4e6d93@newsspool2.arcor-online.net> <4e5e58ee$0$2996$a8266bb1@newsreader.readnews.com> <4e5e6082$0$7611$9b4e6d93@newsspool1.arcor-online.net> <4e5e61b1$0$2716$a8266bb1@newsreader.readnews.com> <4e5e628c$0$7608$9b4e6d93@newsspool1.arcor-online.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <4e5eae87$0$7624$9b4e6d93@newsspool1.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 31 Aug 2011 23:58:31 CEST NNTP-Posting-Host: ceb4c202.newsspool1.arcor-online.net X-Trace: DXC=l?WT8QFCUXn;iVb[J9ZZP`ic==]BZ:afn4Fo<]lROoRa<`=YMgDjhgb8Y9d<0BE=7gPCY\c7>ejVh:Djn3kdmQQln6Fo8Z;;SRb X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:21777 Date: 2011-08-31T23:58:31+02:00 List-Id: On 31.08.11 18:43, Adam Beneschan wrote: > On Aug 31, 9:34 am, Georg Bauhaus > wrote: > >>>> True when there is an object; but what about >> >>>> (some expression)'Value ? >> >>> Use T(expression)'Value when you must. >> >> Even so, >> >> X := T'(if condition then >> 1.2 >> else >> 3.5)'Value; > > Hang on... doesn't the argument of 'Value need to be a string? I > think this conversation took a wrong turn up there---you all meant > 'Image, right? OK, yes, I was too, uh, quick, I meant "1.2" and "3.5 and so on. I'll like the polymorphing Value function best. But Dmitry mentions objects as the result of parsing. To me, this seems more about persistent objects than about something that assists newcomers with quickly writing values (of numbers and of enums) in and out. Isn't persistence better served by 'Output and 'Input? Isn't part of the argument about the gap between untagged and tagged types? Rather than changing 'image and 'value, some Ada effort, IMHO, is better directed towards the creation of a flexible, portable tracing package, if tracing seems to dominate the use cases of quick 'Img. Would it work? Starting from: procedure P ... X : ... begin ... put_line (current_error, "In P, value X is=" & T'image(X)); I'd imagine a portable compiler magic package: package Source_Info is ... trace : Source_Info.T; Trace.Set_Output (Current_Error); procedure P ... X : ... begin ... Trace.Debug ("value X is=", X); I am assuming that the compiler will be determining procedure P's full name, and can either infer the type of X and then select or synthesize a suitable transformation function, or will ask the user for assistance as necessary. The output format can be configured, etc. I cannot imagine a project where such a package would not be used. Maybe it is irritating that there should be procedures that have more magic than others. Some syntax should help lessen the surprise. A magic trace package is even easier to use for newcomers and programmers alike. It is also portable, unlike 'Img. Fancy words like "compiler assisted code injection" etc. will allow marketing. Come to think of it, Eiffel has a reserved word, "debug", not sure about compiler magic for source info.