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=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,a8985ede8fe3d111 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1994-10-15 23:07:49 PST Path: bga.com!news.sprintlink.net!howland.reston.ans.net!math.ohio-state.edu!jussieu.fr!univ-lyon1.fr!swidir.switch.ch!epflnews!dinews.epfl.ch!di.epfl.ch!Robb.Nebbe From: Robb.Nebbe@di.epfl.ch (Robb Nebbe) Newsgroups: comp.lang.ada Subject: Re: Is Ada the future? [was: Is C++ the future?] Date: 14 Oct 1994 09:31:38 GMT Organization: Ecole Polytechnique Federale de Lausanne Sender: nebbe@lglsun3.epfl.ch (Robb Nebbe) Distribution: world Message-ID: <1994Oct14.094121@di.epfl.ch> References: <1994Oct4.090807@di.epfl.ch> <37kanl$jfd@u.cc.utah.edu> NNTP-Posting-Host: lglsun3.epfl.ch Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Date: 1994-10-14T09:31:38+00:00 List-Id: val@cs.weber.edu (Val Kartchner) writes: |> I have also been reading about Ada 9X. In the booklet "Introducing Ada |> 9X", Section 2.7, "Hierarchical Libraries", pp 20-23 and Section 2.8, |> "Private Child Units", pp. 24-26 have text and code examples which |> demonstrate these secion summaries (in the report's own words): |> |> The important special visibility rule is that the private part (if any) |> and the body of the child have visibility of the private part of their |> parent. |> |> The private part and body of any child can access the private part of |> its parent (and grandparent...). |> |> Unless there is some subtlty that I've missed in the pages of *both* text |> and code, all that one has to do to get access to the private datatypes |> is to declare a child package. (Note: this doesn't include renaming of |> private interfaces, but does allow the foreign child to call private |> interfaces and thereby effectively rename a private interface.) |> |> Would an Ada programmer /ever/ knowingly defeat the intent of the package |> interface and do this? No, I don't think so. Do you? :-S One way to think of child packages is that they are equivalent (not exactly but close) to nested packages except you get the benefit of separate compilation. I believe the intent is that a module may be extended without disturbing the parent or to provide special interfaces for certain clients. As long as you express what you are doing clearly in the code a language really shouldn't get in your way. (Ada83 is guilty of this) This is quite different than the language doing things implicitly that you didn't ask it to do. The is no way to accidently gain visibility of the private part of a package and as you said you cannot accidently make any private declarations visible in the public part of the child. - Robb Nebbe