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,8b8748382fcfacc1 X-Google-Attributes: gid103376,public From: "John J. Rusnak" Subject: Re: friend classes in ada95 Date: 2000/04/17 Message-ID: <38FBE174.9FCD06B7@mindspring.com>#1/1 X-Deja-AN: 612536055 Content-Transfer-Encoding: 7bit References: <38F6B617.34E216A7@emw.ericsson.se> <38F6D9F0.F0DE08E4@geocities.com> <8d7lqt$cgu$1@epos.tesco.net> X-Accept-Language: en X-Server-Date: 18 Apr 2000 04:21:05 GMT Content-Type: text/plain; charset=us-ascii Organization: MindSpring Enterprises Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 2000-04-18T04:21:05+00:00 List-Id: Robert A Duff wrote: > "Steve Folly" writes: > > > > package X.Y is > > > -- Cannot see X's private part > > > > Not true - according to the LRM (I forget which section off the top of my > > head) child package visibility rules are the same as if you had declared (in > > this case) Y inside X at the end of it's private part after all other > > declarations. > > If you look up that section, you'll have trouble finding it. ;-) > > The visible part of a child cannot see the parent's private part, > unless it's a private child. > > - Bob Under GNAT, I have made use of the fact that a child package can see its parent's private part even if it is NOT a private child. This could just be an error in the compiler, though. (I have seen this technique used for implementing something simliar to "protected" elements in C++ or Java as well as friend classes). Does anyone have the section number? -John