comp.lang.ada
 help / color / mirror / Atom feed
From: stt@houdini.camb.inmet.com (Tucker Taft)
Subject: Re: Chunks of finalized
Date: 1997/10/06
Date: 1997-10-06T00:00:00+00:00	[thread overview]
Message-ID: <EHn0qA.n2p.0.-s@inmet.camb.inmet.com> (raw)
In-Reply-To: EHJ3F6.JA0@world.std.com


Robert A Duff (bobduff@world.std.com) wrote:

: ...
: Why wait until the next Push (which might be a long time, or never)?
: Inside the generic, you could declare:

:     type Stack_Element_Holder(Present: Boolean := False) is
:         record
:             case Present is
:                 when False => null;
:                 when True => The_Element: Stack_Element_Type;
:             end case;
:         end record;

: And then build the stack out of arrays of these things.  Then, whenever
: you Pop, assign a "Stack_Element_Holder'(Present => False)" into the
: vacated slot.  I think this achieves what the original poster wanted --
: it will call Finalize on The_Element (if its controlled), and it will
: also call Finalize on all controlled subcomponents of The_Element.  And
: there's no need to pass in an extra finalization operation, nor to
: handle subcomponents by hand.  It costs an extra Boolean component for
: every stack element, though.

It might be easier to just take an extra generic IN parameter,
an "Empty_Value" of the Stack_Element_Type.  This value could be
used to initialize and reinitialize the stack elements.

: - Bob

--
-Tucker Taft   stt@inmet.com   http://www.inmet.com/~stt/
Intermetrics, Inc.  Burlington, MA  USA




  reply	other threads:[~1997-10-06  0:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-10-03  0:00 Chunks of finalized Richard A. O'Keefe
1997-10-03  0:00 ` Robert A Duff
1997-10-03  0:00 ` Stephen Leake
1997-10-04  0:00   ` Robert A Duff
1997-10-06  0:00     ` Tucker Taft [this message]
1997-10-07  0:00       ` Richard A. O'Keefe
1997-10-05  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