comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@cs.nyu.edu (Robert Dewar)
Subject: Re: Q. on Automatic Package Finalization
Date: 1996/09/23
Date: 1996-09-23T00:00:00+00:00	[thread overview]
Message-ID: <dewar.843529239@schonberg> (raw)
In-Reply-To: 523tt4INNlu7@snoopy.cis.ohio-state.edu


iDave said

"Hi.  Does anyone know of a good way to achieve automatic package
finalization in Ada95?  I'd like to create a generic package which
automatically cleans up its package instance state (possibly including
allocated memory, temporary files, etc.) when the package scope ends.
The code below (which compiles under GNAT 3.05) is one attempt to
achieve this using controlled types.  It requires that the
representation of state for package P instances be incorporated into
an instance (pkg_var) of a controlled type (PC.T) declared
in a library-level package (PC).  This is not a very satisfactory
solution even if it would work.  Does anyone have some better
ideas for handling automatic package finalization?"

This seems a perfectly reasonable approach, and indeed it was knowing
that this approach existed that made it seem unwise to clutter the language
with yet another feature for handling this case specifically.





  reply	other threads:[~1996-09-23  0:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-09-22  0:00 Q. on Automatic Package Finalization david scott gibson
1996-09-23  0:00 ` Robert Dewar [this message]
1996-09-24  0:00   ` Norman H. Cohen
1996-09-24  0:00     ` Tucker Taft
1996-09-25  0:00   ` Jens Jakob Jensen
1996-09-25  0:00   ` Norman H. Cohen
  -- strict thread matches above, loose matches on Subject: below --
1996-09-28  0:00 Robert Dewar
1996-10-04  0:00 ` Norman H. Cohen
1996-10-04  0:00   ` Robert Dewar
1996-09-28  0:00 Robert Dewar
1996-10-04  0:00 ` Norman H. Cohen
1996-10-06  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