comp.lang.ada
 help / color / mirror / Atom feed
From: mfeldman@seas.gwu.edu (Michael Feldman)
Subject: Re: integer'image
Date: 22 Jan 91 19:21:20 GMT	[thread overview]
Message-ID: <2584@sparko.gwu.edu> (raw)
In-Reply-To: 29979@shamash.cdc.com

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

  parent reply	other threads:[~1991-01-22 19:21 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <2563@sparko.gwu.edu>
1991-01-18 19:13 ` integer'image Arthur Evans
1991-01-18 20:32   ` integer'image Michael Feldman
1991-01-20  2:54   ` integer'image       Hoysch
1991-01-20 23:10     ` integer'image Michael Feldman
1991-01-21 15:23     ` integer'image Jerry Callen
1991-01-21 19:41       ` integer'image Steven V. Case
1991-01-21 21:54         ` integer'image Jerry Callen
1991-01-22 19:21         ` Michael Feldman [this message]
1991-01-22 21:37           ` integer'image Richard Pattis
1991-01-23 16:29             ` integer'image Michael Feldman
1991-01-18 23:05 ` integer'image (George C. Harrison) Norfolk State University
1991-01-19 10:51 ` integer'image Jean Pierre Rosen
1991-01-28  3:27 integer'image Jim West (Stealth Contractor)
1991-01-28 15:04 ` integer'image Michael Feldman
1991-01-28 23:09   ` integer'image (George C. Harrison) Norfolk State University
1991-01-29 19:55     ` integer'image stephen edwards
  -- strict thread matches above, loose matches on Subject: below --
2000-04-17  0:00 integer'image NANCY HEHIR
2000-04-17  0:00 ` integer'image Ted Dennison
2000-04-18  0:00   ` integer'image Marin D. Condic
2000-04-18  0:00     ` integer'image Ted Dennison
2000-04-18  0:00       ` integer'image Marin D. Condic
2000-04-17  0:00 ` integer'image tmoran
2000-04-19  0:00 ` integer'image MaggieJohn
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox