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,37c86f3bf9ffa41c X-Google-Attributes: gid103376,public From: bobduff@world.std.com (Robert A Duff) Subject: Re: Language lawyer question - private packages. Date: 1997/01/21 Message-ID: #1/1 X-Deja-AN: 211345290 references: <32E493CA.5001@ozemail.com.au> organization: The World Public Access UNIX, Brookline, MA newsgroups: comp.lang.ada Date: 1997-01-21T00:00:00+00:00 List-Id: In article <32E493CA.5001@ozemail.com.au>, Chris Miller wrote: >One for the language lawyers. > >Assume that you have two sets of packages as followes :- > > package A is ... end; > private package A.B is ... end; > package A.B.C is ... end; > >AND > > package A is ... end; > private package A.B is ... end; > private package A.B.C is ... end;-- * different. If you have a package A.Something_Else, then in the first example, it can have "with A.B.C;" on its body, whereas in the second example, it could not. To any package outside the "A" hierarchy, it makes no difference -- both A.B and A.B.C are invisible. Think of the whole hierarchy. The same rules apply at each level -- a body (or private spec) can 'with' its private siblings, and a parent body can 'with' its private children. But not private grandchildren. And remember that A is a (public) child of Standard. In your second example, A.B.C is invisible outside the subsystem rooted at A.B, whereas in your first example it is invisible outside the subsystem rooted at A. You can make subsystems and sub-subsystems, and sub-sub-systems, and so forth. For any given package, you need to understand that it is private or public WITH RESPECT TO some particular ancestor -- that is, it might be public with respect to its parent, but private with respect to its grandparent. Advice: Make packages "private" when you can. - Bob