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-27 14:58:35 PST Path: nntp.gmd.de!dearn!blekul11!ccsdec1.ufsia.ac.be!reks.uia.ac.be!idefix.CS.kuleuven.ac.be! Belgium.EU.net!EU.net!howland.reston.ans.net!usc!elroy.jpl.nasa.gov!lll-winken.llnl.gov!fnnews.fnal.gov!stc06.ctd.ornl.gov!mbk From: mbk@jt3ws1.etd.ornl.gov (Kennel) Newsgroups: comp.lang.ada Subject: Re: Type extension questions Date: 27 Mar 1995 20:37:52 GMT Organization: Oak Ridge National Lab, Oak Ridge, TN Message-ID: <3l77n0$hdb@stc06.ctd.ornl.gov> References: <3l0frd$b9t@lang8.cs.nyu.edu> Reply-To: kennel@msr.epm.ornl.gov NNTP-Posting-Host: jt3ws1.etd.ornl.gov X-Newsreader: TIN [version 1.2 PL2] Date: 1995-03-27T20:37:52+00:00 List-Id: Harry Koehnemann (koehnema@enuxsa.eas.asu.edu) wrote: > Well, yes and no. What I really want to do is restrict the interface > to a type. It might help to see an example. Let's pretend we have 2 > abstract data types, where one is an extension of the other: > class List { > public: Set (...) { ...} > private: ...; > }; > class Stack : private List { > public: Push() { ...} > private: ...; > }; > It is not appropriate for a Stack to invoke Set. One could argue that > Stack has-a List instead of Stack is-a list (I think Tucker Taft made > this argument earlier). Bottom line - I guess there is no way to > perform private inheritance, as shown in the above example, in Ada95, > which was my question. Thanks for the input. I wouldn't call this 'has-a' *or* 'is-a'. I would call it 'is-implemented-as-a'. For example, we may want many features from List to be *public*, and yet still *not* allow a Stack to be substituted at run-time for a List. {i.e. divorce subtyping from inheritance, a convenient idea i've found} How ought one do this in Ada? cheers matt