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: dgibson@snoopy.cis.ohio-state.edu (david scott gibson) Subject: Re: Multiple Type Interfaces Date: 1997/01/28 Message-ID: <5cm4raINN6ru@snoopy.cis.ohio-state.edu>#1/1 X-Deja-AN: 212967669 references: <6PbObMf-3RB@herold.franken.de> <32EE352A.167EB0E7@cis.ohio-state.edu> <32EE6EF2.2487@watson.ibm.com> organization: The Ohio State University, Department of Computer and Information Science newsgroups: comp.lang.ada Date: 1997-01-28T00:00:00+00:00 List-Id: In article <32EE6EF2.2487@watson.ibm.com>, Norman H. Cohen wrote: >Dave Gibson wrote: > >> When Ada83 evolved into Ada95, the concept of multiple type >> components (packages) survived, but was excluded when it came to >> OO-style (extendable) tagged types. > >Not true. It's perfectly possible for an Ada-95 package to provide two >different tagged types. This might be done, for example, because the >two types share parts of their (hidden) implementations. > >If a package provides two types, T1 and T2, you cannot declare a >subprogram in the package that has both a controlling operand (i.e., a >parameter or a function result) of type T1 and one of type T2, because >it would not be obvious in this case which operand's tag should control >dispatching. However, you can have one operand of type T1 (controlling >dispatching) and one of type T2'Class (not controlling dispatching) or >the other way around. 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. Dave -- dgibson@cis.ohio-state.edu