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.9 required=5.0 tests=BAYES_00 autolearn=ham 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-25 03:29:28 PST 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.moneng.mei.com!uwm.edu!news.alpha.net!news.mathworks.com!zombie.ncsc.mil!admii!cmcl2!thecourier.cims.nyu.edu!thecourier.cims.nyu.edu!nobody From: comar@cs.nyu.edu (Cyrille Comar) Newsgroups: comp.lang.ada Subject: Re: Type extension questions Date: 25 Mar 1995 02:13:49 -0500 Organization: Courant Institute of Mathematical Sciences Message-ID: <3l0frd$b9t@lang8.cs.nyu.edu> References: NNTP-Posting-Host: lang8.cs.nyu.edu Date: 1995-03-25T02:13:49-05:00 List-Id: koehnema@enuxsa.eas.asu.edu (Harry Koehnemann) writes: : 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? (sorry for previous empty message, I try again) Don't try to be too close to C++, this doesn't fit Ada's model. "Private inheritance" is meaningless in Ada since "Private" is a caracteristic of packages and inheritance a characteristic of types but you can still do something very close from what you want : package P is type T is tagged private; procedure Visible_Method (X : T); private procedure Private_Method (X : T); type T is ... end P; with P; use P; package Q is type T2 is new T with ....; end Q; a client of Q can use the inherited Visible_Method but not Private_Method (unless the client happen to be child of P but this is an other story... ;-) -- ------------------------------------------------------------------------ Cyrille Comar, E-mail: comar@cs.nyu.edu Gnat Project US phone: (212) 998-3489