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: jsa@alexandria (Jon S Anthony) Subject: Re: Multiple Type Interfaces Date: 1997/01/29 Message-ID: #1/1 X-Deja-AN: 213118188 sender: news@organon.com (news) references: <6PbObMf-3RB@herold.franken.de> 19: 15:38 -0500 organization: Organon Motives, Inc. newsgroups: comp.lang.ada Date: 1997-01-29T00:00:00+00:00 List-Id: In article <5cm4raINN6ru@snoopy.cis.ohio-state.edu> dgibson@snoopy.cis.ohio-state.edu (david scott gibson) writes: > Norman H. Cohen wrote: > > >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. Nothing. It is a primitive operation of T1 not T2. Since T1 was not extended, nothing happens with it. > 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. Hmmmm, that is a slippery point. A package extension is part of the same scope as its parent (and all the way up), but not part of its "immediate" scope. So, the operation is "there" in the extension in the sense that it can be directly used in the extension without any "with" or anything. If you are an outside client, and you want the extension stuff for T2 and the T1 stuff, you only have to with the child (with A.B). But, if you want direct visibility to both the new T2 stuff and the T1 stuff, you have to "use" them both (use A, A.B). /Jon -- Jon Anthony Organon Motives, Inc. Belmont, MA 02178 617.484.3383 jsa@organon.com