comp.lang.ada
 help / color / mirror / Atom feed
From: clines@delete_this.airmail.net (Kevin Cline)
Subject: Re: Flexible Strings (was Equality operator...)
Date: 1997/05/02
Date: 1997-05-02T00:00:00+00:00	[thread overview]
Message-ID: <3F2AA8DEC61418AE.502E81A8ECA1C4E7.3A25DE2FB38755A4@library-proxy.airnews.net> (raw)
In-Reply-To: mheaney-ya023680003004972301380001@news.ni.net


mheaney@ni.net (Matthew Heaney) wrote:

>In article <9704301422.AA07755@most>, "W. Wesley Groleau (Wes)"
><wwgrol@PSESERV3.FW.HAC.COM> wrote:
>
>>I never had a problem implementing an Ada-83 equivalent of bounded strings
>>so that no heap was required.  Did it pretty much as Matt Heaney suggested,
>>after reviewing a couple of "free" dynamic_strings packages and finding
>>that nearly every operation leaked heap.
>
>Many people don't realize that Ada was more or less designed to that you
>don't have to use heap.

Heap usage is required for programs which solve problems whose size
is unknown and run on machines with unknown memory resources.
Embedded applications don't have these requirements, so dynamic allocation
wasn't interesting to the Ada '83 design team.

>
>The problem with Ada 83 is that when you do need it, memory leaks are bound
>to happen, because clients often forget to clean up the data structure. 
>Thankfully, this has been corrected in Ada 95.

Too late, too late...


>Explicit_Conversion:
>declare
>   SA : constant String_Buffer_Array :=  (
>      To_String_Buffer ("I'd"), 
>      To_String_Buffer ("gladly"), 
>      To_String_Buffer ("lose"),
>      To_String_Buffer ("me"),
>      To_String_Buffer ("to"),
>      To_String_Buffer ("find"),
>      To_String_Buffer ("you"));

This is about the point where C++ programmers turn away laughing.





  parent reply	other threads:[~1997-05-02  0:00 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-04-30  0:00 Flexible Strings (was Equality operator...) W. Wesley Groleau (Wes)
1997-04-30  0:00 ` Matthew Heaney
1997-05-01  0:00   ` Robert Dewar
1997-05-02  0:00   ` Kevin Cline [this message]
1997-05-03  0:00     ` Jon S Anthony
1997-05-03  0:00     ` Robert Dewar
1997-05-04  0:00       ` Kevin Cline
1997-05-04  0:00         ` Robert Dewar
1997-05-06  0:00           ` Kaz Kylheku
1997-05-07  0:00             ` Kevin Cline
1997-05-07  0:00               ` Jon S Anthony
1997-05-07  0:00               ` Robert Dewar
1997-05-07  0:00               ` Robert A Duff
1997-05-07  0:00               ` Matthew Heaney
1997-05-07  0:00                 ` Jon S Anthony
1997-05-07  0:00             ` Robert Dewar
1997-05-07  0:00             ` Robert A Duff
1997-05-07  0:00               ` Robert Dewar
1997-05-08  0:00               ` Robert I. Eachus
1997-05-07  0:00             ` Robert Dewar
1997-05-09  0:00           ` Erik Magnuson
1997-05-10  0:00             ` John G. Volan
1997-05-10  0:00               ` Robert Dewar
1997-05-10  0:00                 ` Matthew Heaney
1997-05-11  0:00                   ` Robert Dewar
1997-05-12  0:00               ` Erik Magnuson
1997-05-10  0:00             ` Robert Dewar
1997-05-10  0:00               ` Matthew Heaney
     [not found] <199705010554.WAA24507@ni1.ni.net>
1997-05-01  0:00 ` W. Wesley Groleau (Wes)
1997-05-02  0:00   ` Robert Dewar
replies disabled

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