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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,68c80d9ad156e257 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1995-03-24 04:19:42 PST Newsgroups: comp.lang.ada Path: nntp.gmd.de!news.rwth-aachen.de!news.rhrz.uni-bonn.de!news.uni-stuttgart.de!rz.uni-karlsruhe.de!xlink.net!howland.reston.ans.net!news.sprintlink.net!cs.utexas.edu!uunet!inews.intel.com!itnews.intel.com!chnews!ennews!koehnema From: koehnema@enuxsa.eas.asu.edu (Harry Koehnemann) Subject: Re: Type extension questions Message-ID: Nntp-Posting-Host: enuxsa.eas.asu.edu Sender: news@ennews.eas.asu.edu (USENET News System) Reply-To: koehnema@enuxsa.eas.asu.edu (Harry Koehnemann) Organization: Arizona State University Date: Thu, 23 Mar 1995 22:05:25 GMT References: <1995Mar22.125057@di.epfl.ch> Followup-To: comp.lang.ada Date: 1995-03-23T22:05:25+00:00 List-Id: In article <1995Mar22.125057@di.epfl.ch> Robb.Nebbe@di.epfl.ch (Robb Nebbe) writes: >In article , koehnema@enuxsa.eas.asu.edu (Harry Koehnemann) writes: >|> >|> 1) Is it possible to derive a type such that the parent operations are not >|> available to the user of the new type? This question is equivalent to >|> the ability to do private inheritance ala C++ - class B: private A { ...}; >|> I would assume the answer is yes, but haven't yet figured out how. > >Yes. For example when you need a type to be controlled typically you don't >want to expose the finalize, initialize and adjust operations to the client >so you write: > > package P is > > type T is private; > > private > > type T is new Ada.Finalization.Controlled with ... > > procedure Adjust( Object : in out T ); I don't think my request was clear enough. This is close, but I'd like P.T to be extensible. The above approach hides the fact that P.T is tagged and therefore extensions of P.T are not allowed. What I really want is private inheritance ala C++. Thanks for the reply. Any other suggestions? -- Harry Koehnemann Arizona State University hek@asu.edu Computer Science Department