comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@merv.cs.nyu.edu (Robert Dewar)
Subject: Re: Ada 83 versions of Ada 95 packages
Date: 1996/12/24
Date: 1996-12-24T00:00:00+00:00	[thread overview]
Message-ID: <dewar.851451055@merv> (raw)
In-Reply-To: 19961224155500.KAA09943@ladder01.news.aol.com


johnherro proposed

package Ada83_Strings_Unbounded is
   type Unbounded_String(Length : Integer := 0) is private;
   function "+"(Right : in String) return Unbounded_String;
   function "+"(Right : in Unbounded_String) return String;
   function "&"(Left, Right : in Unbounded_String) return
Unbounded_String;
private
   type Unbounded_String(Length : Integer := 0) is
      record
         Text : String(1 .. Length);
      end record;
end Ada83_Strings_Unbounded;


This is confusingly named. The type involved is more like a fixed string
than an unbounded string, so it is confusing to reuse the Ada 95 name
in a completely misleading manner (especially given the subject line of
this thread!)

You can probably fairly easily adapt the GNAT unbounded string package to
Ada 83, with the following notes:

a. Of course the name of the package has to be changed

b. you cannot use controlled, so that means you probably want to add an
   explicit free operation (in practice this will be the biggest difference
   between Ada 83 and Ada 95 versions of this package).

Otherwise, you should be able to use these packages more or less directly!





  reply	other threads:[~1996-12-24  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 [this message]
1996-12-24  0:00     ` johnherro
1996-12-24  0:00       ` Norman H. Cohen
1996-12-25  0:00         ` johnherro
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