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,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: Ted Dennison Subject: Re: Controlled types in local generics? Date: 1999/12/31 Message-ID: <386CF432.1B1522AE@telepath.com>#1/1 X-Deja-AN: 566928074 Content-Transfer-Encoding: 7bit References: <386AFDA8.7C3110CC@telepath.com> <84g2va$q8u$1@nnrp1.deja.com> <386BB71D.CB7920FD@telepath.com> <84ik6r$hp2$1@nnrp1.deja.com> X-Accept-Language: en,pdf Content-Type: text/plain; charset=us-ascii X-Complaints-To: Abuse Role , We Care X-Trace: monger.newsread.com 946664289 216.14.8.95 (Fri, 31 Dec 1999 13:18:09 EST) Organization: Telepath Systems (telepath.com) MIME-Version: 1.0 NNTP-Posting-Date: Fri, 31 Dec 1999 13:18:09 EST Newsgroups: comp.lang.ada Date: 1999-12-31T00:00:00+00:00 List-Id: Robert Dewar wrote: > In article <386BB71D.CB7920FD@telepath.com>, > Ted Dennison 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