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,d10596e187e90822 X-Google-Attributes: gid103376,public From: dale@cs.rmit.edu.au (Dale Stanbrough) Subject: Re: Private Children Date: 1999/06/23 Message-ID: #1/1 X-Deja-AN: 492793794 References: <7klja3$c0p$1@nnrp1.deja.com> <376E70A5.F77E558D@averstar.com> <376E9EEB.322A3F39@averstar.com> <7kmoe4$o83@dfw-ixnews15.ix.netcom.com> X-Complaints-To: abuse@cs.rmit.edu.au X-Trace: emu.cs.rmit.edu.au 930110395 23257 144.205.16.58 (23 Jun 1999 03:59:55 GMT) Organization: RMIT NNTP-Posting-Date: 23 Jun 1999 03:59:55 GMT Newsgroups: comp.lang.ada Date: 1999-06-23T03:59:55+00:00 List-Id: Matthew Heaney wrote: " Every child (C1, C2) has access to the private part of its parent (P). There's no such thing as "hiding within a hierarchy."" There is. Consider the following... pacakge P is end P; package P.A is type X is private; ... end A; with P.A; package P.B is type Y is private; -- operations on Y private type Y is record Item : X; end record; end P.B; Clearly package P.B has no access to the private implementations of package P.A (and they -are- in the same hierachy, it's just that one is not a lineal (package) descendent of the other). Consider the following... The example above compiles fine. External users of type Y are happy. Package P.B is prevented from knowing the internal implementation of type X. But let's also assume that we didn't want to give access to type X to the rest of the world. What I would -like- to do is to make P.A private, so that it can't be seen, but still retain type X's private status. It would be nice if i could simply make P.A. a private package. Unfortunately Ada confuses "compilation privacy" with "implementation privacy". I am forced (simply because I want to hide some internal details) to sacrifice my privacy designs to the gods of compilation efficiency (which is the opposite of what "private" means in the rest of Ada). " Child packages were designed not to hide visibility from within the hierarchy. They were designed to /deliberately/ expose the private part to children, and to allow you to easily identify which packages have that private knowledge." Yes I know that, but I'm not concerned about parent/child packages, but about sibling (or rather non lineal descendant) packages/privacy issues. I think that the current situation forces too much exposure of implementation issues that will cause package hierachies to end up a large entagled mess, because we are continually forced to abandon internal privacy goals to meet external ones. Dale