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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,d4e2f238dc61c890,start X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!postnews.google.com!j22g2000hsf.googlegroups.com!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Protected types and visibility of their internals Date: Tue, 8 Jul 2008 02:57:56 -0700 (PDT) Organization: http://groups.google.com Message-ID: NNTP-Posting-Host: 128.141.45.223 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1215511076 1485 127.0.0.1 (8 Jul 2008 09:57:56 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 8 Jul 2008 09:57:56 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: j22g2000hsf.googlegroups.com; posting-host=128.141.45.223; posting-account=bMuEOQoAAACUUr_ghL3RBIi5neBZ5w_S User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9) Gecko/2008061004 Firefox/3.0,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:1036 Date: 2008-07-08T02:57:56-07:00 List-Id: 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? My first natural attempt was to put the declaration of Some_Type in the private part of PT, but this seems to be impossible even at the grammar level. My second, although less natural attempt was to put it to the private part of P, but then it is not visible to PT. The only place that seems to be allowed is the visible part of P. I don't find it very comfortable, because I do not intend the users of P to see Some_Type. What is the rationale for this? Can you recommend some other solution that enforces strict coding practice? -- Maciej Sobczak * www.msobczak.com * www.inspirel.com