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.7 required=5.0 tests=BAYES_00,INVALID_DATE, MSGID_SHORT,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!olivea!uunet!seas.gwu.edu!mfeldman From: mfeldman@seas.gwu.edu (Michael Feldman) Newsgroups: comp.lang.ada Subject: Re: integer'image Message-ID: <2584@sparko.gwu.edu> Date: 22 Jan 91 19:21:20 GMT References: <2563@sparko.gwu.edu> <10140@as0c.sei.cmu.edu> <13874@encore.Encore.COM> <29979@shamash.cdc.com> Reply-To: mfeldman@seas.gwu.edu () Organization: The George Washington University, Washington D.C. List-Id: In article <29979@shamash.cdc.com> case@shamash.cdc.com (Steven V. Case) writes: >I have encountered this situation frequently enough that I work around it >by calling a subprogram to strip leading spaces. I suspect that most of you >have some sort of string manipulation package that you have either >developed or purchased. I made sure that mine has support for removing >leading and trailing spaces (in addition to other operations). Then when I >want to get rid of the trailing space, I don't have to embed statements >like INTEGER'IMAGE(I)(2..INTEGER'IMAGE(I)'LAST), but can use a statement >such as REMOVE_LEADING_SPACES(FROM => INTEGER'IMAGE(I)). This is probably >more readable, therefore it won't 'gag a maggot'. I suspect this is the >general idea that Mr. Hoysch was suggesting when he said 'or a very simple >routine if this is too hard on the eyes.' Humbug! I hope the Ada9x team is reading this thread, to see the sort of totally unnecessary grief is caused by what IMHO is a foolish nonuniformity that's got to be nearly trivial to fix. Since 'image will need to call some runtime routine to convert integer to string, I suggest that 'image carry a second parameter, just like the Put routines do, to control the width. So as not to disable existing programs, default it to whatever is currently used. A Width parameter is really just the right way, it seems to me, since then a value of 1 (or 0) says "give me exactly the right number of characters" and a greater value suggests padding if necessary. Even better, give us a third parameter to control whether padding is on the left or on the right. Make Text_IO conform, too. Attributes are one example of a _really neat_ thing in Ada that works intuitively about 90% of the time, and the 10% nonuniformity makes the good stuff a bear to learn and causes annoyances like the above to work around the nonuniformities. I know, I know. I missed my shot to submit this as a revision request. I assume someone else did, though. I'll check in my archive of RRs. Mike Feldman