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: a07f3367d7,c689b55786a9f2bd X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!feeder3.cambriumusenet.nl!feed.tweaknews.nl!193.201.147.71.MISMATCH!xlned.com!feeder3.xlned.com!feeder.erje.net!eternal-september.org!.POSTED!not-for-mail From: Charmed Snark Newsgroups: comp.lang.ada Subject: Re: for S'Image use Func?? Date: Mon, 10 May 2010 15:16:05 +0000 (UTC) Organization: The Snarky Insanitorium Message-ID: References: <2318cabb-080c-42a0-8219-21c347abe172@o11g2000yqj.googlegroups.com> Injection-Date: Mon, 10 May 2010 15:16:05 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="9f8M0iN5t54V+4DF/iqO8g"; logging-data="27432"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/uVborFSGzaj8O5z89rErkeUqMQH8XeYk=" User-Agent: Xnews/5.04.25 X-Face: &6@]C2>ZS=NM|HE-^zWuryN#Z/2_.s9E|G&~DRi|sav9{E}XQJb*\_>=a5"q]\%A;5}LKP][1mA{gZ,Q!j Cancel-Lock: sha1:nEYU6bKkWaSeyn/ZoKK27yxqQrM= Xref: g2news2.google.com comp.lang.ada:11446 Date: 2010-05-10T15:16:05+00:00 List-Id: expounded in news:Pine.LNX.4.64.1005071004460.24406@medsec1.medien.uni- weimar.de: > On Thu, 6 May 2010, Warren wrote: > >> I'm just being a typical lazy programmer (not always >> wanting to lookup the correct package prefix for >> the To_String() function to use). > > How about overloading the &-operator: > > function "&"(S: String; Item: T) return String; > > if X is of type T and you "use type T", you can replace the expression > > T'Image(X) > > by > > "" & X > > If your T'Image(X) is part of a larger string expression, overloading & > appears to be very convenient (for the "typical lazy programmer", as > you put it): > > Ada.Text_IO.Put_Line("The first result is " & X & > " the second result is " & Y & "."); > > So long > > Stefan That's not a bad idea- thanks. Warren