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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.236.203.113 with SMTP id e77mr23074988yho.15.1398263568705; Wed, 23 Apr 2014 07:32:48 -0700 (PDT) X-Received: by 10.140.50.83 with SMTP id r77mr78332qga.15.1398263568679; Wed, 23 Apr 2014 07:32:48 -0700 (PDT) Path: border2.nntp.dca3.giganews.com!backlog4.nntp.dca3.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!peer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!m5no4638834qaj.1!news-out.google.com!du2ni14151qab.0!nntp.google.com!m5no4638829qaj.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 23 Apr 2014 07:32:48 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=83.145.50.10; posting-account=3_reEwoAAAC163IAIrx427KYmwahFuh9 NNTP-Posting-Host: 83.145.50.10 References: <7f1c01c5-3563-4b94-9831-152dbbf2ecdc@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <9f156351-e3d0-4d86-b816-1d5e09ee69da@googlegroups.com> Subject: Re: Your wish list for Ada 202X From: =?ISO-8859-1?Q?bj=F6rn_lundin?= Injection-Date: Wed, 23 Apr 2014 14:32:48 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 2723 X-Received-Body-CRC: 2009432252 X-Original-Bytes: 2965 Xref: number.nntp.dca.giganews.com comp.lang.ada:186024 Date: 2014-04-23T07:32:48-07:00 List-Id: Den onsdagen den 23:e april 2014 kl. 15:57:03 UTC+2 skrev J-P. Rosen: > Le 23/04/2014 14:55, bj=F6rn lundin a =E9crit : > > I'd like V'Img to be standard ada like T'Image(V); As in the gnat > > implementation >=20 > >=20 >=20 > No big cost, no big benefit... >=20 No big cost, but the benefit is when you are in someone else code, or you have a fairly big system, with type definitions in several files. You then need to include the whole type Pkg_with_Long_Name.Child_pkg_With_Even_Longer_Name.T'Image(V) instead of V'img Not a great leap for mankind, but still improvement. I find myself often use 'img in gnat, because it is easy. Yes, I'm lazy, but many people are lazy. Also, If I'd like a logfile statement, which I often do I very much prefer V'img before Pkg_with_Long_Name.Child_pkg_With_Even_Longer_Name.T'Image(V) >=20 > > Also, I'd like to be able to define the string function for a record > > type to be used for the 'image attribute. > > type T2 is record A : T; B : T; end record; > > function F_T2_Image(O : T2) return String is begin return O.A'Img & " > > " O.B'Img; end F_T2_Image; > >=20 > > for T2'Image use F_T2_Image > >=20 > > V2 : T2; .. Put_Line(V2'Img); > >=20 >=20 > And what is the benefit over writing: >=20 > Put_Line (F_T2_Image (V2)); not very much. But the usual case is that you have to write Pkg_with_Long_Name.Child_pkg_With_Even_Longer_Name.F_T2_Image(V2) instead of V2'img /Bj=F6rn