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!news1.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!novia!newspump.sol.net!news.mv.net!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: for S'Image use Func?? Date: Fri, 07 May 2010 10:25:37 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <4be417b4$0$6992$9b4e6d93@newsspool4.arcor-online.net> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1273242336 6054 192.74.137.71 (7 May 2010 14:25:36 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Fri, 7 May 2010 14:25:36 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:PgOO0rXT1TXYfNSkSENZlqGuhg4= X-Original-Bytes: 3447 Xref: g2news2.google.com comp.lang.ada:11370 Date: 2010-05-07T10:25:37-04:00 List-Id: Georg Bauhaus writes: > With 'Width given, and with 'Value reading "+123" like > " 123", WRT to what is there a mistake? I don't think I've ever used 'Width in my entire life. Anyway, 'Width has little to do with 'Image, since 'Image doesn't have a Width parameter. And 'Value also accepts " 123 ", which is not an argument for putting in a whole bunch of blanks. > Would there be a discussion at all if "+123" had > been chosen as the result of 'Image (123)? Then there'd be a different discussion, about the "annoying plus sign". ;-) Num_Errors, like most integer subtypes, doesn't have any negative numbers. Putting in a "+" sign makes even less sense than putting in a blank. >> I don't want nice formatted output. I want the human-readable >> string image of the number, and for 123, that's "123", >> not " 123". > > "123" to be the only representation ever wanted for 123 seems > like a far reaching assumption to me. Others may want "+123" for > positive, "#123" for negative etc. And "123" just *happens* to > be what one might want in this or that case. "123" is by far the most common representation wanted. And if you want to stick in a blank or a "+", it's easy to concatenate that, whereas removing such junk is verbose and error prone. Sometimes, you want ", and" after the number -- but you don't want 'Image to stick that in for you! > I imagine that writing two statements for "just a number > and a string" makes some programmers feel annoyed because two > statements instead of one---though involving two functions---seems > verbose. > > Put (Num_Errors); > Put_Line (" errors detected."); The problem with the Text_IO design is that it mixes I/O with formatting. It would be cleaner to separate these. It would also be cleaner to separate I from O, but that's another story. Anyway, the question was, "Why on Earth would they put in that annoying blank?" As far as I can tell, the correct answer is "No reason -- they did it by mistake." You can't answer the question by pointing out various workarounds. And teaching beginners how to instantiate generics, when there's a simple 'Image feature, is not a good idea. - Bob