comp.lang.ada
 help / color / mirror / Atom feed
From: "Hibou57 (Yannick Duchêne)" <yannick_duchene@yahoo.fr>
Subject: Re: Protected object which never get finalized
Date: Mon, 15 Feb 2010 23:26:07 +0100
Date: 2010-02-15T23:26:07+01:00	[thread overview]
Message-ID: <op.u76wltl8hgxj9a@garhos> (raw)
In-Reply-To: nospam-2B414A.15231915022010@news.aioe.org

Le Mon, 15 Feb 2010 21:23:19 +0100, John B. Matthews  
<nospam@nospam.invalid> a écrit:
> is "protected type A_Type" a valid completion of "type A_Type is limited
> 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 really  
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 ::=
>      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 the  
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 partial  
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 which  
you can inherit from, but they can implement interface abstract types. But  
don't bother other it, and look next, you will understand why this seeming  
ambiguity about the tagged/non-tagged status of a protected type, does not  
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, as  
they are limited by definition, they can be the completion/full-definition  
of a type whose public view is limited.

As you see, the core answer is mainly provided, implicitly (as an implied  
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



  parent reply	other threads:[~2010-02-15 22:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-13  0:45 Protected object which never get finalized Hibou57 (Yannick Duchêne)
2010-02-14 12:35 ` John B. Matthews
2010-02-15 18:08   ` sjw
2010-02-15 19:22     ` Hibou57 (Yannick Duchêne)
2010-02-15 19:20   ` Hibou57 (Yannick Duchêne)
2010-02-15 20:23     ` John B. Matthews
2010-02-15 20:44       ` Adam Beneschan
2010-02-15 22:26       ` Hibou57 (Yannick Duchêne) [this message]
2010-02-16  0:23         ` John B. Matthews
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox