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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fac41,2c6139ce13be9980 X-Google-Attributes: gidfac41,public X-Google-Thread: 1108a1,2c6139ce13be9980 X-Google-Attributes: gid1108a1,public X-Google-Thread: 103376,3d3f20d31be1c33a X-Google-Attributes: gid103376,public X-Google-Thread: f43e6,2c6139ce13be9980 X-Google-Attributes: gidf43e6,public From: jsa@alexandria.organon.com (Jon S Anthony) Subject: Re: Interface/Implementation (was Re: Design by Contract) Date: 1997/09/02 Message-ID: #1/1 X-Deja-AN: 269620661 References: Distribution: world Organization: PSINet Newsgroups: comp.object,comp.software-eng,comp.lang.ada,comp.lang.eiffel Date: 1997-09-02T00:00:00+00:00 List-Id: In article nospam@thanks.com.au (Don Harrison) writes: > Try thinking along the lines of > > a) Ada interfaces correspond to Eiffel short forms, and > b) Ada abstract types correspond to Eiffel deferred classes. Agreed. > In terms of b), the Ada (corrections welcome): > > package P is > type T is abstract tagged private; > procedure Do_Something (X: T) is abstract; -- deferred/abstract > private > type T is tagged record > Y: Integer; > end record; > end; > > > is basically equivalent to the Eiffel: > > deferred class T > feature > do_something is deferred end -- deferred/abstract > feature {NONE} > y: INTEGER > end. This looks right to me. > Deriving effective (concrete) descendants from these, we might have the Ada: > > with P; > package Q is > type New_T is new P.T; > procedure Do_Something (X: T); > end; > > package body Q is > procedure Do_Something (X: T) is begin .. end; -- effective > end; Actually, the body has nothing to do with it. The concrete declaration in the spec. is the "effective" one (there could be many [completely different] bodies implementing it) > and the corresponding Eiffel: > > deferred class NEW_T > inherit T > feature > do_something is do .. end -- effective > end. Agreed. > :>Tons. See DejaNews... > > Whether or not they convinced anyone is another matter, however. Convincing has nothing to do with it. /Jon -- Jon Anthony OMI, Belmont, MA 02178, 617.484.3383 "Nightmares - Ha! The way my life's been going lately, Who'd notice?" -- Londo Mollari