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,d4e2f238dc61c890 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!198.186.194.249.MISMATCH!news-out.readnews.com!transit3.readnews.com!panix!bloom-beacon.mit.edu!newsswitch.lcs.mit.edu!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Protected types and visibility of their internals Date: Tue, 08 Jul 2008 12:13:33 -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 1215533613 4305 192.74.137.71 (8 Jul 2008 16:13:33 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Tue, 8 Jul 2008 16:13:33 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:BPtP3MIcXPmL8OeN9K1LzutjE7k= Xref: g2news1.google.com comp.lang.ada:1039 Date: 2008-07-08T12:13:33-04:00 List-Id: Maciej Sobczak writes: > Consider a protected type in some package: > > package P is > protected type PT is > procedure Foo; > private > X : Some_Type; > end PT; > end P; > > The protected type has a component X of Some_Type, which is entirely > the private business of the protected type. > > Where this type should be declared? I don't think there's any good solution to this. You could put it in a nested package called Private_Stuff, with a comment saying clients shouldn't mess with it. > What is the rationale for this? I don't remember exactly, but I think there are anomalies if you start allowing types to be declared inside types. - Bob