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,f443e975621b7347 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news.glorb.com!wns13feed!worldnet.att.net!attbi_s21.POSTED!53ab2750!not-for-mail From: "Jeffrey R. Carter" User-Agent: Thunderbird 1.5.0.10 (Windows/20070221) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Hiding details and protected types References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <5IsXh.13313$n_.7303@attbi_s21> NNTP-Posting-Host: 12.201.97.213 X-Complaints-To: abuse@mchsi.com X-Trace: attbi_s21 1177442177 12.201.97.213 (Tue, 24 Apr 2007 19:16:17 GMT) NNTP-Posting-Date: Tue, 24 Apr 2007 19:16:17 GMT Organization: AT&T ASP.att.net Date: Tue, 24 Apr 2007 19:16:17 GMT Xref: g2news1.google.com comp.lang.ada:15265 Date: 2007-04-24T19:16:17+00:00 List-Id: Maciej Sobczak wrote: > > It is not possible to declare this type in the private part of the > protected type (why?), so it has to be declared outside PT: > > type T is ...; > protected type PT is > procedure P; > private > A : T; > end PT; > > The problem is that declaring T in the same declaration scope pollutes > the name space and is against Good Engineering Principles (tm). I agree. You can't hide the existence of T, but you can usually hide its details: type T is private; protected type P is ... private type T is ...; -- Jeff Carter "Beyond 100,000 lines of code you should probably be coding in Ada." P. J. Plauger 26