comp.lang.ada
 help / color / mirror / Atom feed
From: guerby@gnat.com (Laurent Guerby)
Subject: Re: overload ":=" ???
Date: 1996/07/22
Date: 1996-07-22T00:00:00+00:00	[thread overview]
Message-ID: <ws97mrvsot6.fsf@schonberg.cs.nyu.edu> (raw)
In-Reply-To: 4soh73$56h@newsbf02.news.aol.com


Laurent> This "sort of string" is built in Ada 95 under the name
Laurent> Bounded_String.

David> I looked at that, and it would be great, but...  RM A.04.04.106
David> seems to say that this isn't good with dynamic pointers (or am
David> I misreading this?)

   First, here is the GNAT implementation of Bounded_String:

   private

      type Bounded_String is record
         Length : Length_Range := 0;
         Data   : String (1 .. Max_Length);
      end record;

   So I guess it's very close to what you want, with a big bonus, all
Ada 95 String handling routines are waiting to be used. Note that
you'll need to instanciate a generic to use it.

   Second, A.4.4(106) is an "implementation advice" which states:

RM>			       Implementation Advice
RM>
RM> 106   Bounded string objects should not be implemented by implicit pointers
RM> and dynamic allocation.

   As far as I understand it, it advices (not requires) compiler
writers not to use a pointer and "new" to implement this type (this
kind of stuff is for Unbounded_Strings). This is not at all a concern
to the user, who sees only "type Bounded_String is private".

David> what about "write-ability" ????

   Please define "write-ability" (I don't want to assume it's related
to the number of characters to type ;-).

David> This signature will self-destruct in 10 seconds...

   Boom ;-).

-- 
Laurent Guerby <guerby@gnat.com>, Team Ada.
   "Use the Source, Luke. The Source will be with you, always (GPL)."




  parent reply	other threads:[~1996-07-22  0:00 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-07-17  0:00 overload ":=" ??? David Morton
1996-07-17  0:00 ` Robert Dewar
1996-07-18  0:00   ` Laurent Guerby
1996-07-18  0:00   ` David Morton
1996-07-19  0:00     ` David Weller
1996-07-19  0:00     ` Brad Balfour
1996-07-25  0:00   ` Wolfgang Gellerich
1996-07-25  0:00     ` Robert A Duff
1996-07-18  0:00 ` John Herro
1996-07-18  0:00   ` Robert Dewar
1996-07-19  0:00     ` John Herro
1996-07-21  0:00       ` David Morton
1996-07-21  0:00       ` Laurent Guerby
1996-07-22  0:00         ` Robert A Duff
1996-07-23  0:00           ` Laurent Guerby
1996-07-23  0:00             ` Robert A Duff
1996-07-23  0:00             ` John Herro
1996-07-22  0:00       ` David Morton
1996-07-22  0:00         ` Robert Dewar
1996-07-23  0:00         ` Robert A Duff
1996-07-22  0:00           ` Robert Dewar
1996-07-22  0:00       ` Laurent Guerby [this message]
1996-07-22  0:00       ` Laurent Guerby
1996-07-23  0:00       ` Tarjei Jensen
1996-07-23  0:00         ` Robert A Duff
1996-07-24  0:00       ` Robert I. Eachus
1996-07-18  0:00 ` Jon S Anthony
1996-07-19  0:00 ` Joerg Ozimek
replies disabled

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