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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,81bb2ce65a3240c3 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.201.168 with SMTP id kb8mr6322954pbc.3.1335933013590; Tue, 01 May 2012 21:30:13 -0700 (PDT) Path: r9ni122152pbh.0!nntp.google.com!news1.google.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: Shark8 Newsgroups: comp.lang.ada Subject: Re: What would you like in Ada202X? Date: Tue, 1 May 2012 21:28:13 -0700 (PDT) Organization: http://groups.google.com Message-ID: <5460348.1571.1335932893467.JavaMail.geo-discussion-forums@pbnh4> References: <27237299.27.1335909906091.JavaMail.geo-discussion-forums@vbmh6> NNTP-Posting-Host: 96.2.54.122 Mime-Version: 1.0 X-Trace: posting.google.com 1335933013 19076 127.0.0.1 (2 May 2012 04:30:13 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 2 May 2012 04:30:13 +0000 (UTC) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=96.2.54.122; posting-account=lJ3JNwoAAAAQfH3VV9vttJLkThaxtTfC User-Agent: G2/1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2012-05-01T21:28:13-07:00 List-Id: > > How would it be less convenient without the space? A big problem is th= at 'Image adds an extra space for nonnegative numbers but not for negative = numbers, so if you want debug or log output that doesn't look messy you eit= her have to concatenate an extra space somewhere else and live with having = two spaces in the output, or use Trim or something like that. Well, it depends on the format of the debugging, doesn't it? Consider the following (in a monospaced font) Debug Log for simulation 128 Position_X: 13 Position_Y:-4 Turn_Index: 8 Ext_Damage: 14 Int_Damage: 0 Squid_Fire: True Could it be written [formatted] better? Yes. Could it be worse? XML. It seems perfectly adequate to me. > OK, I guess that if you know your numbers aren't negative maybe it might = be OK. But I've found the extra space to be a nuisance, including for debu= gging and logging outputs. > Sounds like the formatting I'm used to from FORTRAN... The position > for the sign indicator was always included in the width of the output > field, whether or not "+" was printed or implied. That's probably exactly where it came from. The interop w/FORTRAN would hav= e given Ada a big boost in numeric processing "back in the day" and having = 'Image and 'Value read/write that way by default ALSO meant that old data-f= iles could more-easily be read in. But, in any case Function Image( Input: In Integer ) Return String is use Ada.Strings, Ada.Strings.Fixed; begin Return Trim( Source =3D> Integer'Image(Input), Side =3D> Ada.Strings.= Left ); end Image; is not too bad; the real downside is that currently we can't do something l= ike: Function Image( Input: In Integer ) Return String Renames Ada.Strings.Fixed( Source =3D> Integer'Image(Input), -- Have it "know" about the para= ms passed Side =3D> Ada.Strings.Left ); and have the whole thing in a spec file. (The 2012 standard fixes that so t= hat we can have expressions named as functions, IIUC.) So, is this a big is= sue? On the other hand, being able to override the 'Image (and 'Value) attribute= s might be appropriate.