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: 109fba,9ac62ca34a465706 X-Google-Attributes: gid109fba,public X-Google-Thread: 103376,9ac62ca34a465706 X-Google-Attributes: gid103376,public From: mab@dst17.wdl.loral.com (Mark A Biggar) Subject: Re: on OO differnces between Ada95 and C++ Date: 1996/02/21 Message-ID: <4gg6da$8jk@wdl1.wdl.loral.com>#1/1 X-Deja-AN: 140493209 distribution: world references: <4gbq7q$g08@qualcomm.com> <4gdidj$10f5@watnews1.watson.ibm.com> organization: Loral Western Development Labs newsgroups: comp.lang.ada,comp.lang.c++ Date: 1996-02-21T00:00:00+00:00 List-Id: In article <4gdidj$10f5@watnews1.watson.ibm.com> ncohen@watson.ibm.com writes: > package Parent is > type Auxiliary_Type is ...; > type P is tagged ...; > procedure Op (X: in out P; Y: in Auxiliary_Type); > ... > end Parent; > > package Parent.Child is > type D is new P with ...; > procedure Op (X: in out D; Y: in Auxiliary_Type); > ... > end Parent.Child; > >A compilation unit that mentions Parent.Child in a with clause is, in >effect, really importing a version of Parent with Parent.Child nested >inside of it, so the declaration of Auxiliary_Type comes along. Given the above example, is the following code legal, I have been unable to determine if it is from the RM95: with Parent.Child; package My_Package is A: Parent.Child.Auxiliary_Type; -- or must I say A: Parent.Auxiliary_Type end My_Package; If the above is illegal then it presents a problem if I have a library level renaming of Parent.Child, like so: package My_Child renames Parent.Child; with My_Child; package Foo is A: My_Child.Auxiliary_Type; -- LEGAL? end Foo; If this type of naming is legal then there is a simple emulation of Norman's multi-part package proposal using child packages and a library level rename. -- Mark Biggar mab@wdl.loral.com