Re: Interfaces and private types



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
.



Relevant Pages

  • Re: Interfaces and private types
    ... descendant of an interface type if and only if the full type is ... this is illegal because type T does not have the interface Int. ... overriding procedure Init; ...
    (comp.lang.ada)
  • RE: Running public IPs inside an RFC 1597 network
    ... > I'm running a typical Class C RFC 1597 network in my lab. ... know or care if we humans designate a subnet as public or private. ... is the absolute most general route there is for a machine. ... In a correctly configured system when you define an interface, ...
    (freebsd-questions)
  • Re: Object Oriented Content System - the idea
    ... Would probably be difficult to enforce this militant style in PHP. ... (It's java, but you probably don't have to know java to see what's going ... The advantage of keeping them private or protected has been to prevent using ... way of private inner class and interface) In PHP this typically means another ...
    (comp.lang.php)
  • Re: NAT troubleshooting
    ... I dont follow...which interface are you talking about? ... Private interface does ... You don't really Need that NIC for NAT to work. ... Ethernet adapter Local Area Connection: ...
    (microsoft.public.windows.server.networking)
  • Re: Getting and Setting and best practise
    ... the appropriate PRIVATE getter/setter. ... simplified the object's interface. ... Validation also becomes ... getters/setters would have PRIVATE scope and would run automatically and ...
    (comp.lang.php)