comp.lang.ada
 help / color / mirror / Atom feed
From: "W. Wesley Groleau (Wes)" <wwgrol@PSESERV3.FW.HAC.COM>
Subject: Re: Flexible Strings (was Equality operator...)
Date: 1997/05/01
Date: 1997-05-01T00:00:00+00:00	[thread overview]
Message-ID: <9705011408.AA06677@most> (raw)
In-Reply-To: 199705010554.WAA24507@ni1.ni.net


(Also posted to comp.lang.ada)

:> >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.
:>
:> 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.

The problem with the packages I was offered was that the clients COULDN'T
clean up the heap.  These guys had every string on the heap, and if a client
wanted to say A := A & B the result was a new allocation overwriting the
previous pointer in A.

:> I got the "+" idea from Barnes' book.  Don't think of it as a hack; think
:> of it as what it is: the identity operator.  It's a happy medium between
:> the 2 extremes.

I agree with you that automatic conversion is generally harmful.  And that
too much explicit conversion is information hiding of the wrong sort, i.e.,
hiding the abstraction in implementation clutter.  The thing with "+" is
more an issue of retraining one's instincts--after more than 35 years, it's
hard not to think of it as something associated with quantities.  But then,
the strangeness of it is a point in its favor because it catches the
attention.  If it were routine, being only a single character, it could
easily be overlooked.

---------------------------------------------------------------------------
W. Wesley Groleau (Wes)                                Office: 219-429-4923
Hughes Defense Communications (MS 10-41)                 Home: 219-471-7206
Fort Wayne,  IN   46808                  (Unix): wwgrol@pseserv3.fw.hac.com
--
SPAM should be sent to   I.want.one@mailbombs.for.idiots.org
If you want to be prosecuted under 27 USC 227, go ahead and send it here.
---------------------------------------------------------------------------




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

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <199705010554.WAA24507@ni1.ni.net>
1997-05-01  0:00 ` W. Wesley Groleau (Wes) [this message]
1997-05-02  0:00   ` Flexible Strings (was Equality operator...) Robert Dewar
1997-04-30  0:00 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
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             ` 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-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-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
replies disabled

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