comp.lang.ada
 help / color / mirror / Atom feed
From: Philippe Tarroux <philippe.tarroux@limsi.fr>
Subject: Re: Interfaces and private types
Date: Tue, 29 Jan 2008 14:08:25 +0100
Date: 2008-01-29T14:08:25+01:00	[thread overview]
Message-ID: <fnn8da$pea$1@news2.u-psud.fr> (raw)
In-Reply-To: <479f208d$0$27200$9b4e6d93@newsspool1.arcor-online.net>

Georg Bauhaus a �crit :
> Philippe Tarroux schrieb:
>> Randy Brukardt wrote:
>>> Specifically, it violates 7.3(7.3/2): "the partial view shall be a
>>> descendant of an interface type (see 3.9.4) if and only if the full 
>>> type is
>>> a descendant of the interface type."
>>>   As written, this is illegal because type T does not have the 
>>> interface Int.
>> As it is written the compiler i use doesn't mention any error and i 
>> interpreted this construct as legal because :
>>
>> 1/ the interface is synchronized thus allowing to derive concurrent 
>> or non concurrent types
>> 2/ The partial view is a descendant of the interface type
>> 3/ The full view precises that the partial view correspond to a 
>> concurrent type but hides this detail to the user
>
> I'd rather think that the compiler should diagnose conflicting
> declaration of T in the private part as the private T does not
> declare a relation with the public T.
Yes I agree if one adopt the principle that an explicity declaration is 
more readable (and more in accordance with the general Ada philosophy). 
It is indeed true that the relation between the public and private T's 
was implicit in my example.
>
> If you do not want to derive T publicly, why not
>
> package Test_Interfaces is
>
>   type Int is synchronized interface;
>   procedure Init (I : in out Int) is abstract;
>
>   type T is limited private;
>
> private
>
>   task type T is new Int with
>      overriding entry Init;
>   end T;
> end Test_Interfaces;
>
I agree too.Your solution removes the ambiguity.

Philippe Tarroux



  reply	other threads:[~2008-01-29 13:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-28 17:16 Interfaces and private types Philippe Tarroux
2008-01-28 18:21 ` Georg Bauhaus
2008-01-28 22:58 ` Randy Brukardt
2008-01-29  9:35   ` Philippe Tarroux
2008-01-29 12:48     ` Georg Bauhaus
2008-01-29 13:08       ` Philippe Tarroux [this message]
2008-01-29 23:29     ` Randy Brukardt
replies disabled

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