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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,104df2b9b7a2f689 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news.glorb.com!newscon02.news.prodigy.com!newscon06.news.prodigy.com!prodigy.net!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Interfaces Date: 17 May 2005 11:35:58 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <8764xj9wzf.fsf@deneb.enyo.de> <877jhz0y52.fsf@deneb.enyo.de> <87sm0mcjbx.fsf@deneb.enyo.de> <1rfnp5x3lxi3n$.mvahuo5ag68a$.dlg@40tude.net> <87u0l26rww.fsf@deneb.enyo.de> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1116344158 14258 192.74.137.71 (17 May 2005 15:35:58 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Tue, 17 May 2005 15:35:58 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: g2news1.google.com comp.lang.ada:11068 Date: 2005-05-17T11:35:58-04:00 List-Id: "Dmitry A. Kazakov" writes: > On Tue, 17 May 2005 12:57:51 +0200, Florian Weimer wrote: > > > * Dmitry A. Kazakov: > > > >>>> That alone would not help much. Consider you have overridden J1.Foo and > >>>> J2.Foo using different implementations, then which one will be called on > >>>> Foo (X)? > >>> > >>> How would this be possible in the single-inheritance-with-interfaces > >>> model? > >> > >> There cannot be any feasible single inheritance / multiple interface model. > >> Any inheritance is either single or multiple. Implementation vs. interface > >> inheritance is an orthogonal issue. > > > > That's why I don't understand your question. The condition is always > > false, isn't it? > > Not in every context! In the context of a class-wide method of J1 it is > unambiguous. Or else, consider T that implements J1 publicly and J2 > privately. I believe that's illegal. You're not allowed to privately implement an interface. Anyway, I thought you were worried about the case where T implements J1 and J2, both of which have type-conformant Foo's. And you override them separately. Then it's clear which one you dispatch to from J1'Class and J2'Class. But if you have an object X of type T, which overriding does Foo(X) call? The Eiffel solution is to rename one of them. Another solution would be to have some hierarchical notation for saying "call the Foo that originally came from J1". - Bob