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,c52c30d32b866eae X-Google-Attributes: gidfac41,public X-Google-Thread: 103376,2ea02452876a15e1 X-Google-Attributes: gid103376,public X-Google-Thread: 1108a1,c52c30d32b866eae X-Google-Attributes: gid1108a1,public From: donh@syd.csa.com.au (Don Harrison) Subject: Re: Real OO Date: 1996/04/04 Message-ID: #1/1 X-Deja-AN: 145718964 sender: news@assip.csasyd.oz references: <4jbmsk$uo5@watnews1.watson.ibm.com> organization: CSC Australia reply-to: donh@syd.csa.com.au newsgroups: comp.lang.ada,comp.lang.eiffel,comp.object Date: 1996-04-04T00:00:00+00:00 List-Id: In case anyone is confused about how Eiffel's and Ada's parameter mechanisms compare, the following hopefully summarizes them: SUPPLIER CLIENT BINDING -------- ------ ------- Assuming: Ada: type A_TYPE is private -- tagged m: A_TYPE; type B_TYPE is private -- tagged mc: A_TYPE'Class; n: B_TYPE; nc: B_TYPE'Class; Eiffel: class A_TYPE ... end m: A_TYPE class B_TYPE ... end n: B_TYPE Case1 ----- Ada: procedure f (a: A_TYPE) f (m); static f (mc); dynamic But if f not defined in same spec: f (m); static f (mc); static Eiffel (inside A_TYPE): f m.f dynamic Case 2 ------ Ada: procedure g (a: A_TYPE'Class) g (m) static g (mc) static Eiffel (inside A_TYPE): frozen g m.g static Case 3 ------ Ada: procedure h (a: A_TYPE; b: B_TYPE'Class) h (m, n) static h (m, nc) static h (mc, n) dynamic (on mc) h (mc, nc) dynamic (on mc) Eiffel (inside A_TYPE): h (b: B_TYPE) m.h (n) dynamic Case 4 ------ Ada: procedure i (a: A_TYPE'Class; b: B_TYPE'Class) i (m, n) static i (m, nc) static i (mc, n) static i (mc, nc) static Eiffel (inside A_TYPE): frozen i (b: B_TYPE) m.i (n) static ------------------------------------------------------------------------------------ The following is ILLEGAL because polymorphism requires that an operation can be primitive for at most one class. Case 5 ------ Ada: procedure j (a: A_TYPE; b: B_TYPE) Eiffel: No equivalent. ------------------------------------------------------------------------------------ Conclusion: Ada: - more efficient, but - manual optimisation places a burden on developer - reduced flexibility/reusability - syntactically complex Eiffel: - less efficient, but - automatic optimisation means that the the efficiency gap is reduced as is the burden on developer - greater flexibility/reusability - syntactically simple Don.