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: a07f3367d7,cb04cee6116c8ced X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!u-picardie.fr!news.ecp.fr!news.jacob-sparre.dk!pnx.dk!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Package's private parts and protected types Date: Mon, 8 Feb 2010 18:48:39 -0600 Organization: Jacob Sparre Andersen Message-ID: References: <7ff3810f-3ee3-4f39-a54c-933ad7d0655c@36g2000yqu.googlegroups.com> <1v2la97s2yyvd.1rcy0ana8mver.dlg@40tude.net> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1265676520 31712 69.95.181.76 (9 Feb 2010 00:48:40 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Tue, 9 Feb 2010 00:48:40 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5843 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 Xref: g2news1.google.com comp.lang.ada:9008 Date: 2010-02-08T18:48:39-06:00 List-Id: "Dmitry A. Kazakov" wrote in message news:1v2la97s2yyvd.1rcy0ana8mver.dlg@40tude.net... > On Mon, 8 Feb 2010 00:30:12 -0800 (PST), Martin wrote: > >> This is true of task types too. > > I don't think so. The task specification does not expose barriers and > local > variables of its body. But the protected type specification does its > private operations and components: > > package P is > protected type T is > ... > private > ... -- Why is it here? Is it C++ or Ada? > end T; > private > ... -- It belongs here! Or better to the package body > end P; > > Obviously to me, the syntax should have been like: For what it's worth, the Ada 95 Rationale says (http://www.adaic.com/standards/95rat/RAThtml/rat95-p2-9.html#1): The other data components of a protected object must be declared in the specification of the type to ensure that the size is known to the compiler when the type is used by a caller. However these components are only accessible from protected operations defined in the body of the protected type and thus are declared in the private part of the protected type. (And I have no intent of trying to defend this!) Randy.