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.1 required=5.0 tests=BAYES_00, PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.4 Path: buffer2.nntp.dca1.giganews.com!border2.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!goblin2!goblin.stu.neva.ru!reality.xs3.de!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: How to get this space away? Date: Wed, 3 Jun 2015 18:00:53 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <0b23f4af-9a55-4d1d-be90-f74b316a95cf@googlegroups.com> NNTP-Posting-Host: rrsoftware.com X-Trace: loke.gir.dk 1433372455 2405 24.196.82.226 (3 Jun 2015 23:00:55 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Wed, 3 Jun 2015 23:00:55 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Xref: number.nntp.giganews.com comp.lang.ada:193475 Date: 2015-06-03T18:00:53-05:00 List-Id: "J-P. Rosen" wrote in message news:mknp7j$4s1$1@dont-email.me... > Le 03/06/2015 21:07, Laurent a écrit : >> On Wednesday, June 3, 2015 at 12:28:34 AM UTC+2, Jeffrey R. Carter wrote: >> >>> >'Image always adds a leading space >>> > for a non-negative value. Nobody seems to like it, but the ARG won't >>> > change it. >> Does the ARG give a reason for not wanting to change it? Does that mean >> that in the >> case of a negative value you have to add it yourself? Doesn't really make >> sense. >> > This dates back to Ada83. The initial idea was that a positive number > and its opposite (negative) number should have the same number of > characters. Forcing a '+' to all positive number would not have been > pretty, so the design team chose to put a space for positive numbers > (negative numbers just have an initial '-'). > > At first, it looked like a good idea, especially since 'Image was not > intended to be used extensively, but just for debugging purposes. For > IOs, people are supposed to use Text_IO, which provides all the desired > formatting. In practice, it turned out to be a bad idea, and lots of > programs have some functions to remove the initial space - and now, > changing that would break all these programs. And the ARG is very picky > about upward compatibility. "all these programs" should be "most of these programs". Programs using Trim, as Jeff suggested, won't break. But my code does a lot of this: declare Img : constant String := Natural'Image(Something); begin Log ("Something out of range; Something=" & Img(2..Img'Last)); end; and that would break horribly if the space was removed. The upcoming Corrigendum adds Obj'Image (The GNAT 'Img is used so much that it seems silly to not make it part of the standard); we spent a few minutes discussing that leading space, but eventually we decided that taking it out would be just as confusing (to experts) as leaving it in is (to novices). > The only possibility would be to define a new attribute. Small effort, > small value. Right, and the effort (in the Standard and especially for implementers) probably outweights the value. Randy.