comp.lang.ada
 help / color / mirror / Atom feed
From: Jeffrey Carter <jeffrey.carter@boeing.com>
Subject: Re: Natural to String without space? (newbie question)
Date: Tue, 29 May 2001 23:00:57 GMT
Date: 2001-05-29T23:00:57+00:00	[thread overview]
Message-ID: <3B142A29.EA1349A8@boeing.com> (raw)
In-Reply-To: 3B140ECD.A486A578@ftw.rsc.raytheon.com

Wes Groleau wrote:
> 
> > function Image (N : in Natural) return String is
> >    N_Image : constant String := Natural'Image (N);
> > begin
> >    return N_Image (2 .. N_Image'Last);
> > end Image;
> 
> Call me obsessive, but I feel safer with
> 
>   function Image (N : in Natural) return String is
>      N_Image : constant String := Natural'Image (N);
>   begin
>      return N_Image (N'Image'First + 1 ..
>                      N_Image'Last           );
>   end Image;

OK: You're obsessive.

Actually, in the good old days (1984 or so) I used an Ada-83 compiler
that implemented 'Image with different 'First than 1, despite
ANSI/MIL-STD 1815A explicitly stating that it should be 1, so I tend to
use something more like the 2nd example than the first (except I would
use N_Image'First rather than N'Image'First).

-- 
Jeffrey Carter



  reply	other threads:[~2001-05-29 23:00 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-05-23 15:17 Natural to String without space? (newbie question) Tomas Hlavaty
2001-05-23 22:37 ` DuckE
2001-05-24  6:33 ` Pascal Obry
2001-05-29 21:04   ` Wes Groleau
2001-05-29 23:00     ` Jeffrey Carter [this message]
2001-05-30  7:19     ` Pascal Obry
  -- strict thread matches above, loose matches on Subject: below --
2001-05-23 22:45 Beard, Frank
2001-05-24  7:56 ` Martin Dowie
2001-05-24 21:55 Beard, Frank
2001-05-25  7:30 ` Martin Dowie
2001-05-25  8:30   ` Tomas Hlavaty
2001-05-25 15:05   ` Ehud Lamm
2001-05-28  7:31     ` Martin Dowie
2001-05-25 21:23   ` Ole-Hjalmar Kristensen
replies disabled

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