comp.lang.ada
 help / color / mirror / Atom feed
From: Mats Weber <matsw@mail.com>
Subject: Re: Controlled types in local generics?
Date: 1999/12/30
Date: 1999-12-30T10:12:38+00:00	[thread overview]
Message-ID: <386B3015.F2F094CB@mail.com> (raw)
In-Reply-To: 386AFDA8.7C3110CC@telepath.com

Ted Dennison wrote:

> Surely this isn't saying that all controlled types must be declared at
> the library level? I can't find anything in the LRM that says that, and
> I'm pretty sure some of the booch components use generics with
> controlled types in them.

Yes, all controlled types must be library level. This is very
unfortunate in my opinion.

> This is one instance where I'd dearly love to have an LRM reference in
> the error message...

The rule is not that all controlled types must be library level, but
that a derived tagged type cannot be nested deeper than its parent.
Ada.Finalization.Controlled is at library level, which implies that all
controlled types also must be.

The rule forbidding the nesting of derived types is very reasonable.
What I don't like is that it implies that all controlled types must be
library level.

Maybe this could be circumvented by a generic package similar to
Ada.Finalization that could be instantiated locally and provide the same
facilities as Ada.Finalization ?

Would it be feasible to write such a package for GNAT ?




  parent reply	other threads:[~1999-12-30  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 [this message]
1999-12-30  0:00   ` Robert Dewar
1999-12-30  0:00   ` Ted Dennison
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
replies disabled

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