comp.lang.ada
 help / color / mirror / Atom feed
From: mfeldman@seas.gwu.edu (Michael Feldman)
Subject: Re: integer'image
Date: 20 Jan 91 23:10:33 GMT	[thread overview]
Message-ID: <2577@sparko.gwu.edu> (raw)
In-Reply-To: 1991Jan20.025451.29808@ucselx.sdsu.edu

In article <1991Jan20.025451.29808@ucselx.sdsu.edu> hoysch@ucselx.sdsu.edu (      Hoysch) writes:
>
>	I think a big thing is being made out of something that is not very
>hard to do.  For example INTEGER'IMAGE(I)(2..INTEGER'IMAGE(I)'LAST) will
>do it or a very simple routine if this is too hard on the eyes.  That 
>space, as has been pointed out, is often nice to have to offset the '-'
>of negative numbers.
>
Well, that'll work if I is positive. Otherwise it'll delete the -. So in
any case a test is needed to ascertain the sign. I'd prefer for 'image to
give me what's there, not add extra stuff that I have to delete.

One purpose for the 'image and 'value attributes, it seems to me, is to aid
in _writing_ I/O packages in lieu of (or on top of) Text_IO. The extra
blank just adds an extra bit of aggravation. I'd be happier with it if it
incorporated a general "pad" parameter, but it doesn't.

Recall that the thing that started this thread was developing a terminal-
control package that could easily ship ASCII sequences to a terminal to do
cursor movement, etc. There is no doubt that what you wrote is correct, for
positive values. I was complaining about the arbitrary lack of uniformity
in attributes, and this was the latest. I claim it's much easier to _add_
a blank to get the symmetry between positive and negative numbers than to
_delete_ the blank as you did. Ada9x is looking into the whole problem of
"edit-directed output", which will, if they really do it well, solve a lot
of these problems in a much more general way. Meanwhile, I don't like the
asymmetry between integer PUT and integer'image; in the former I can control
the width precisely because they thought to give me a parameter; in the latter
I cannot, and they decided to stick me with a gratuitous blank. I don't
think gratuitous padding is very user-friendly. The early subset compilers,
by the way, didn't add the blank - it got stuck in there somewhere between
the '80 and '83 versions of the standard, and I think they blew it.

Mike

  reply	other threads:[~1991-01-20 23:10 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     ` Michael Feldman [this message]
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         ` integer'image Michael Feldman
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 tmoran
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-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