From: johnherro@aol.com
Subject: Re: Ada 83 versions of Ada 95 packages
Date: 1996/12/25
Date: 1996-12-25T00:00:00+00:00 [thread overview]
Message-ID: <19961225001000.TAA19975@ladder01.news.aol.com> (raw)
In-Reply-To: 32C058C6.50F3@watson.ibm.com
"Norman H. Cohen" <ncohen@watson.ibm.com> writes:
>The natural way to implement a Bounded_String type
>in Ada 83 is with a record consisting of a fixed-length
>string (whose length is the maximum length for the type)
>and a current-length component.
Yes, and that's exactly what the Ada 83 LRM suggested with its
Text_Handler package. The LRM supplies only the specification, but
writing the body is less than an hour's work, and some Ada 83 compilers
(such as Meridian AdaVantage) come with Text_Handler all ready to use.
With my "pseudo unbounded strings" package, you can at least do this:
Months : array(1 .. 12) of Unbounded_String := (+"January", +"February"
... );
N : Integer := 5;
...
Put_Line(+Months(N));
N(5) := +"The merry, merry month of May";
Put_Line(+Months(N));
However, you're right. To implement Append, etc., you probably first have
to convert to String, storing the result in a string that you know is long
enough.
- John Herro
Software Innovations Technology
http://members.aol.com/AdaTutor
ftp://members.aol.com/AdaTutor
next prev parent reply other threads:[~1996-12-25 0:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
1996-12-23 0:00 Ada 83 versions of Ada 95 packages W. Wesley Groleau (Wes)
1996-12-24 0:00 ` johnherro
1996-12-24 0:00 ` Robert Dewar
1996-12-24 0:00 ` johnherro
1996-12-24 0:00 ` Norman H. Cohen
1996-12-25 0:00 ` johnherro [this message]
1996-12-24 0:00 ` Robert Dewar
1996-12-26 0:00 ` Keith Thompson
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox