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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b87849933931bc93 X-Google-Attributes: gid103376,public From: mheaney@ni.net (Matthew Heaney) Subject: Re: Multiple Type Interfaces Date: 1997/01/28 Message-ID: #1/1 X-Deja-AN: 212910383 references: <6PbObMf-3RB@herold.franken.de> <32EE352A.167EB0E7@cis.ohio-state.edu> <32EE6EF2.2487@watson.ibm.com> <5cm4raINN6ru@snoopy.cis.ohio-state.edu> content-type: text/plain; charset=ISO-8859-1 organization: Estormza Software mime-version: 1.0 newsgroups: comp.lang.ada Date: 1997-01-28T00:00:00+00:00 List-Id: In article <5cm4raINN6ru@snoopy.cis.ohio-state.edu>, dgibson@snoopy.cis.ohio-state.edu (david scott gibson) wrote: >Okay, but then assume you want to extend this *package* by adding some >new operations to T2 (but not T1). If you extend T2, what happens to >the operation which had T2'Class as a parameter. My understanding is >that it would not be present in the interface of the new package, thus >the new package would not be a true extension of the original one. >What I was talking about (as applied to Ada) is really package >extension, not type extension. Yes, but if you have an operation that takes T2'Class in the same package as the declaration of type T2, then what you're saying is that that operation is non-primitive, and you specifically *don't* want it to be inherited by types that derive from T2. I wouldn't bother trying to make the operation directly visible to clients of the child package - let clients get it from the parent package, where it's declared - but if you insist, then you could simply rename it in the child (I think). I don't think it's such a big deal that the operation isn't directly visible from the child package, because clients of the child package have to with the parent anyway, so they've got the non-primitive operation if they really want it: with P.C; package body Q is ... P.Op () vs. P.C.Op () -------------------------------------------------------------------- Matthew Heaney Software Development Consultant (818) 985-1271