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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,8e00db9621be96e0 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!nntp.club.cc.cmu.edu!micro-heart-of-gold.mit.edu!bloom-beacon.mit.edu!panix!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Package Hierarchy and Private functions Date: Wed, 18 Mar 2009 10:19:13 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls6.std.com 1237385953 14492 192.74.137.71 (18 Mar 2009 14:19:13 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Wed, 18 Mar 2009 14:19:13 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:HFR8sHbea9E3tFOFSy8hrtJw2/g= Xref: g2news2.google.com comp.lang.ada:5143 Date: 2009-03-18T10:19:13-04:00 List-Id: "RasikaSrinivasan@gmail.com" writes: > Supposing we have 2 packages like : > > package P is > type Pvt_T is private ; > private > type Pvt_T is ... ; > procedure Pvt_Proc(p : in out Pvt_T) ; > end P ; > > --------------------- > > package P.C is > .... > end P.C ; > > ------------------ > > Is there a way for P.C to access Pvt_Proc (instead of making it > public). The contents of P's private part are visible in the private part and the body of P.C. It's similar to putting a package C nested inside P, but not exactly the same. If you make P.C into a private child package: private package P.C is ... end P.C ; then the contents of P's private part are visible in ALL of P.C, including its visible part. > I guess this may be analogous to protected in C++? Yeah, sort of. - Bob