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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fac41,953e1a6689d791f6 X-Google-Attributes: gidfac41,public X-Google-Thread: 103376,953e1a6689d791f6 X-Google-Attributes: gid103376,public From: donh@syd.csa.com.au (Don Harrison) Subject: Re: Eiffel and Java Date: 1996/11/15 Message-ID: #1/1 X-Deja-AN: 196558307 sender: news@syd.csa.com.au x-nntp-posting-host: dev11 references: <328A411C.388B@watson.ibm.com> organization: CSC Australia, Sydney reply-to: donh@syd.csa.com.au newsgroups: comp.lang.eiffel,comp.lang.ada Date: 1996-11-15T00:00:00+00:00 List-Id: Norman H. Cohen writes: :Ada DOES support separate interface and implementation inheritance: : : package Interface is : type Interface_Type is abstract tagged ...; : ... : end Interface; : : package Parent_Implementation is : type Parent_Implementation_Type is : new Interface.Interface_Type with ...; : ... : end Parent_Implementation; : : package Child_Implementation is : type Child_Implementation_Type is : new Interface.Interface_Type with private; : ... : private : type Child_Implementation_Type is : new Parent_Implementation.Parent_Implementation_Type : with ...; : end Child_Implementation; : :The declaration of Child_Implementation_Type in the visible part of the :package declares this type to be descended from Interface_Type, and this :is all that a client of the Child_Implementation package knows about the :type. The full declaration of Child_Implementation_Type in the private :part indicates that Child_Implementation_Type implements the :Interface_Type interface by inheriting from a particular descendant of :Interface_Type, namely Parent_Implementation_Type. My error. I'm just going to simplify your example and put in some detail to see how you get hold of a 'covariant' operation. (Hope you don't mind). Assuming D_Type inherits from C_Type (and omitting various syntactic details), package A_Module is type A_Type is tagged ...; procedure op (a: A_Type; c: C_Type'Class); ... end A_Module; package B_Module is type B_Type is new A_Module.A_Type with private; procedure op (b: B_Type; c: C_Type'Class); -- Overridden op procedure op (b: B_Type; d: D_Type'Class); -- New, 'covariant' op ... private type B_Type is new A_Module.A_Type with ...; end B_Module; package body B_Module is procedure op (b: B_Type; c: C_Type'Class) is begin op (b, D_Type(c) ); -- No dispatching; Is this valid? exception when others => raise; -- chuck a wobbly! end; procedure op (b: B_Type; d: D_Type'Class) is ... ... end B_Module; Is this how it works? Don. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Don Harrison donh@syd.csa.com.au