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-28 02:17:10 PST Newsgroups: comp.lang.ada Path: nntp.gmd.de!Germany.EU.net!howland.reston.ans.net!news.sprintlink.net!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: Mon, 27 Mar 1995 17:29:07 GMT References: <3l0frd$b9t@lang8.cs.nyu.edu> Followup-To: comp.lang.ada Date: 1995-03-27T17:29:07+00:00 List-Id: In article <3l0frd$b9t@lang8.cs.nyu.edu> comar@cs.nyu.edu (Cyrille Comar) writes: >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 : 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. BTW - I am by no means saying Ada95 should have included such a feature (in fact, I am not a believer in restricting interfaces and think that it clutters a design). I'm just getting my Ada95 facts straight.