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.2 required=5.0 tests=BAYES_00,INVALID_MSGID, 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 From: ncohen@watson.ibm.com (Norman H. Cohen) Subject: Re: Type extension questions Date: 1995/03/27 Message-ID: <3l6q0i$12kj@watnews1.watson.ibm.com>#1/1 X-Deja-AN: 100540724 distribution: world references: <3l0frd$b9t@lang8.cs.nyu.edu> organization: IBM T.J. Watson Research Center reply-to: ncohen@watson.ibm.com newsgroups: comp.lang.ada Date: 1995-03-27T00:00:00+00:00 List-Id: In article <3l0frd$b9t@lang8.cs.nyu.edu>, comar@cs.nyu.edu (Cyrille Comar) writes: |> koehnema@enuxsa.eas.asu.edu (Harry Koehnemann) writes: ... |> : What I |> : really want is private inheritance ala C++. |> |> 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 No, there is a direct Ada analog to a C++ class with a private base class, namely a private type implemented as a tagged derived type: package Base_Type_Package is type Base_Type is tagged ...; ... end Base_Type_Package; with Base_Type_Package; package Derived_Type_Package is type Derived_Type is private; procedure Some_Operation (X: in out Derived_Type); ... private type Derived_Type is new Base_Type_Package.Base_Type with ...; end Derived_Type_Package; -- Norman H. Cohen ncohen@watson.ibm.com