From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM, INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,dfb98535bcaeb3a6 X-Google-Attributes: gid103376,public From: Mats Weber Subject: Re: Controlled types in local generics? Date: 1999/12/30 Message-ID: <386B3015.F2F094CB@mail.com>#1/1 X-Deja-AN: 566446983 Content-Transfer-Encoding: 7bit References: <386AFDA8.7C3110CC@telepath.com> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@sunrise.ch X-Trace: news1.sunrise.ch 946548758 9489 195.141.231.162 (30 Dec 1999 10:12:38 GMT) Organization: sunrise communications ag Mime-Version: 1.0 NNTP-Posting-Date: 30 Dec 1999 10:12:38 GMT Newsgroups: comp.lang.ada Date: 1999-12-30T10:12:38+00:00 List-Id: 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 ?