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,4b758210c0900d03 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,UTF8 Path: g2news1.google.com!news3.google.com!feeder3.cambriumusenet.nl!feed.tweaknews.nl!138.195.8.3.MISMATCH!news.ecp.fr!aioe.org!not-for-mail From: =?utf-8?Q?Hibou57_=28Yannick_Duch=C3=AAne?= =?utf-8?Q?=29?= Newsgroups: comp.lang.ada Subject: Re: Protected object which never get finalized Date: Mon, 15 Feb 2010 23:26:07 +0100 Organization: At Home Message-ID: References: NNTP-Posting-Host: 3asb9hiTRjIGumPMgCsIjA.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes Content-Transfer-Encoding: Quoted-Printable X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.2 User-Agent: Opera Mail/10.10 (Win32) Xref: g2news1.google.com comp.lang.ada:9256 Date: 2010-02-15T23:26:07+01:00 List-Id: Le Mon, 15 Feb 2010 21:23:19 +0100, John B. Matthews = a =C3=A9crit: > is "protected type A_Type" a valid completion of "type A_Type is limit= ed > private;" or is that irrelevant? Nice reaction (you've asked the good question). The way you've worded this question, I guess you have an RM close to = hands, so I will give you an answer using formal references : A short foreword to this reply : the answer to this question is not real= ly = explicit in the RM, and your question mostly get an implied answer (not = = explicit one), but you'll still understand. [ARM 7.3(4)] says : > A private_type_declaration or private_extension_declaration declares > a partial view of the type; such a declaration is allowed only as a > declarative_item of the visible part of a package, and it requires a > completion, which shall be a full_type_declaration that occurs as a > declarative_item of the private part of the package. The completion you've talked about ... Then [ARM 3.2.1(3)] says : > full_type_declaration ::=3D > type defining_identifier [known_discriminant_part] is = > type_definition; > | task_type_declaration > | protected_type_declaration Protected type declarations allowed as full type declaration, which as t= he = latter said, is what (the full type declaration) is expected as the = completion of a partial view. So, so far, protected types allowed here. Then after again [ARM 7.3(6/2)] says : > [...] If the partial view is nonlimited, then the full view shall be > nonlimited. If a tagged partial view is limited, then the full view > shall be limited. [...] Here comes the implicit answer : it only requires that if a if the parti= al = view is non-limited, the full-view must not be limited (otherwise, this = = would be contradictory). The partial view here is limited, so the = completion may be either limited or none limited if the type completion = is = non-tagged, or required to be limited, if the type is tagged. Protected type are a bit a special things : they are not tagged type whi= ch = you can inherit from, but they can implement interface abstract types. B= ut = don't bother other it, and look next, you will understand why this seemi= ng = ambiguity about the tagged/non-tagged status of a protected type, does n= ot = imply an ambiguous answer here. Finally [ARM 7.5(3/2,4/2)] says : > A type is limited if it is a descendant of one of the following: > * a type with the reserved word limited, synchronized, task, or > protected in its definition; So whatever you consider protected type as being tagged or non-tagged, a= s = they are limited by definition, they can be the completion/full-definiti= on = of a type whose public view is limited. As you see, the core answer is mainly provided, implicitly (as an implie= d = consequence) in [ARM 7.3(6/2)] > You're welcome; thank you for an interesting example. You're welcome too -- = No-no, this isn't an oops ...or I hope (TM) - Don't blame me... I'm just= = not lucky