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,FREEMAIL_FROM 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,CP1252 Path: g2news1.google.com!postnews.google.com!m31g2000yqb.googlegroups.com!not-for-mail From: =?ISO-8859-1?Q?Hibou57_=28Yannick_Duch=EAne=29?= Newsgroups: comp.lang.ada Subject: Re: Package's private parts and protected types Date: Tue, 9 Feb 2010 04:43:39 -0800 (PST) Organization: http://groups.google.com Message-ID: <742482e7-82da-471d-b401-6c497a3665de@m31g2000yqb.googlegroups.com> References: <7ff3810f-3ee3-4f39-a54c-933ad7d0655c@36g2000yqu.googlegroups.com> <1v2la97s2yyvd.1rcy0ana8mver.dlg@40tude.net> NNTP-Posting-Host: 77.198.58.172 Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1265719420 7110 127.0.0.1 (9 Feb 2010 12:43:40 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 9 Feb 2010 12:43:40 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: m31g2000yqb.googlegroups.com; posting-host=77.198.58.172; posting-account=vrfdLAoAAAAauX_3XwyXEwXCWN3A1l8D User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; fr),gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:9030 Date: 2010-02-09T04:43:39-08:00 List-Id: On 8 f=E9v, 11:20, "Dmitry A. Kazakov" wrote: > package P is > =A0 =A0protected type T is > =A0 =A0 =A0 ... > =A0 =A0private > =A0 =A0 =A0 ... -- Why is it here? Is it C++ or Ada? > =A0 =A0end T; > private > =A0 =A0... -- It belongs here! Or better to the package body > end P; > About this =93 klugde =94 (as someone called it), here are some words which attempt to explain the reason of this syntax : Quoted from http://www.adaic.com/standards/95rat/RAThtml/rat95-p2-9.html (Rationale 95) > Alternative structures were also considered and rejected. One was > that the private part of a protected unit be visible to the > enclosing package. However, this was considered confusing, and felt > to be inconsistent with the visibility of the private part of a > subpackage. We also considered splitting the protected type (and > task) specification into two separate parts, with the private > operations and data components declared in a second part included > inside the private part of the enclosing package. However, this > seemed like an unnecessary extra syntactic complexity, so we finally > adopted the simpler suggestion from two Revision Requests (RR-0487, > RR-0628) of using private within the specification to demarcate the > private operations.