comp.lang.ada
 help / color / mirror / Atom feed
From: "Marin David Condic" <marin.condic.auntie.spam@pacemicro.com>
Subject: Re: Ada 0x Wish List
Date: Thu, 15 Feb 2001 17:14:13 -0500
Date: 2001-02-15T22:15:19+00:00	[thread overview]
Message-ID: <96hkdn$t08$1@nh.pace.co.uk> (raw)
In-Reply-To: 96hjjl$e1f$2@a1-hrz.uni-duisburg.de

"Georg Bauhaus" <sb463ba@l1-hrz.uni-duisburg.de> wrote in message
news:96hjjl$e1f$2@a1-hrz.uni-duisburg.de...
> David C. Hoos, Sr. (david.c.hoos.sr@ada95.com) wrote:
> : Ada.Strings.Fixed.Trim (Integer'Image (<integer-expression>))
> : will do it without and leading spaces.
>
> The RM tells me that images of numbers start with a space
> or minus sign, and then there is the 'Width attribute so I
> can allocate a string big enough for every possible image...
> Does someone know some source of information that deals with
> the reasons for this choice for 'Image?
>
>
I believe the reasoning behind it was that Ada83 only had strings of fixed
length, so you need to be as predictable as possible WRT the size of some
string conversion. If you're copying to fixed positions in some sort of
output string, you'd like things to align, etc. as well as fitting into a
predictable space. Hence the leading blank or minus. Now that Ada95 provides
unbounded and bounded strings along with all sorts of clever string
manipulation routines, this becomes much less of a concern - but backward
compatibility will keep this around no doubt pretty much forever.

Personally, I'd rather they had just returned the string without the leading
space. 99% of the time, it turns out to be a nuisance that you just work to
get rid of anyway. Having Ada stick that space in there for the 1% of the
time it might be useful just ends up a waste.

MDC
--
Marin David Condic
Senior Software Engineer
Pace Micro Technology Americas    www.pacemicro.com
Enabling the digital revolution
e-Mail:    marin.condic@pacemicro.com
Web:      http://www.mcondic.com/






  reply	other threads:[~2001-02-15 22:14 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-02-12  3:25 Ada 0x Wish List Peter Richtmyer
2001-02-12  4:22 ` Jeffrey Carter
2001-02-12  7:23   ` Dale Stanbrough
2001-02-12 13:04     ` Preben Randhol
2001-02-13 16:33     ` Robert Deininger
2001-02-13 18:15       ` Keith Thompson
2001-02-12  7:39 ` Florian Weimer
2001-02-12 13:18   ` Steve Folly
2001-02-12 15:25   ` Arthur Schwarz
2001-02-12 14:29 ` John English
2001-02-13  8:31   ` Dr Adrian Wrigley
2001-02-13 20:46   ` Fraser Wilson
2001-02-13 22:06     ` Larry Hazel
2001-02-13 22:45       ` Fraser Wilson
2001-02-13 23:14         ` Larry Hazel
2001-02-13 23:59           ` David C. Hoos, Sr.
2001-02-14  1:22             ` Larry Hazel
2001-02-13 23:51     ` Keith Thompson
2001-02-14 11:23     ` David C. Hoos, Sr.
2001-02-15 22:01       ` Georg Bauhaus
2001-02-15 22:14         ` Marin David Condic [this message]
2001-02-17  8:43     ` Dr Adrian Wrigley
2001-02-12 16:08 ` Steve Folly
2001-02-12 17:53   ` Lao Xiao Hai
2001-02-12 18:22 ` (null)
  -- strict thread matches above, loose matches on Subject: below --
2001-02-15  1:33 Beard, Frank
replies disabled

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