comp.lang.ada
 help / color / mirror / Atom feed
From: Ted Dennison <dennison@telepath.com>
Subject: Re: Controlled types in local generics?
Date: 1999/12/31
Date: 1999-12-31T00:00:00+00:00	[thread overview]
Message-ID: <386CF432.1B1522AE@telepath.com> (raw)
In-Reply-To: 84ik6r$hp2$1@nnrp1.deja.com

Robert Dewar wrote:

> In article <386BB71D.CB7920FD@telepath.com>,
>   Ted Dennison <dennison@telepath.com> wrote:
> > As near as I can tell, there's no way around it.
>
> One general approach that is typically used is to include a
> controlled component in the type, rather than making the
> entire structure controlled. Then the finalize routine
> for that component can do whatever it needs to do. Just
> think of what you would have to do if the type was derived
> from some other tagged type (remember no direct MI in Ada :-)

If "what it needs to do" happens to be deallocation of a
dynamicly-allocated non-library-level generic component, its not at all
clear to me how the library controlled object is going to accomplish
that. At some point unchecked_deallocation for a particular generic
object is going to have to be called by someone who has knowledge of
that generic object's type. The protected object is going to have to
have some component that lets it refer to the generic object's pointer
that isn't itself defined in a generic. But as near as I can tell
*nothing* can reference a type declared in a generic unless its is a
child of or is instantiated with that generic (and thus it also has to
be non-library level).

Quite a puzzle you have presented me with...

--
T.E.D.

Home - mailto:dennison@telepath.com  Work - mailto:dennison@ssd.fsi.com
WWW  - http://www.telepath.com/dennison/Ted/TED.html  ICQ  - 10545591






      reply	other threads:[~1999-12-31  0:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-12-30  0:00 Controlled types in local generics? Ted Dennison
1999-12-30  0:00 ` Simon Wright
1999-12-30  0:00 ` Robert Dewar
1999-12-30  0:00   ` Gautier
1999-12-30  0:00     ` Ted Dennison
1999-12-30  0:00 ` Florian Weimer
1999-12-30  0:00 ` Mats Weber
1999-12-30  0:00   ` Ted Dennison
1999-12-30  0:00   ` Robert Dewar
1999-12-30  0:00 ` Robert Dewar
1999-12-30  0:00   ` Ted Dennison
1999-12-31  0:00     ` Robert Dewar
1999-12-31  0:00       ` Ted Dennison [this message]
replies disabled

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