comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: Interfaces
Date: 17 May 2005 11:35:58 -0400
Date: 2005-05-17T11:35:58-04:00	[thread overview]
Message-ID: <wccacmteug1.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: maoz4bx1ltik$.wvr0oufvkzes.dlg@40tude.net

"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> 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



  reply	other threads:[~2005-05-17 15:35 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-16 12:27 Interfaces Florian Weimer
2005-05-16 16:13 ` Interfaces Georg Bauhaus
2005-05-16 16:12   ` Interfaces Florian Weimer
2005-05-16 18:59 ` Interfaces Robert A Duff
2005-05-16 19:27   ` Interfaces Florian Weimer
2005-05-16 20:09     ` Interfaces Robert A Duff
2005-05-16 20:44       ` Interfaces Florian Weimer
2005-05-17  6:14     ` Interfaces Vinzent 'Gadget' Hoefler
2005-05-17 10:53       ` Interfaces Florian Weimer
2005-05-17 13:34         ` Interfaces Vinzent 'Gadget' Hoefler
     [not found]         ` <4289f382$0$10805$afc38c87@>
2005-05-17 16:51           ` Interfaces Pascal Obry
     [not found]             ` <428a2832$0$10805$afc38c87@>
2005-05-17 18:15               ` Interfaces Pascal Obry
2005-05-17 21:11                 ` Interfaces Florian Weimer
2005-05-18 10:36                   ` Interfaces Georg Bauhaus
2005-05-17  7:36     ` Interfaces Dmitry A. Kazakov
2005-05-17  9:06       ` Interfaces Florian Weimer
2005-05-17 10:19         ` Interfaces Dmitry A. Kazakov
2005-05-17 10:57           ` Interfaces Florian Weimer
2005-05-17 11:13             ` Interfaces Dmitry A. Kazakov
2005-05-17 15:35               ` Robert A Duff [this message]
2005-05-17 21:53                 ` Interfaces Florian Weimer
2005-05-17 23:21                   ` Interfaces Randy Brukardt
2005-05-17 23:44                     ` Interfaces Marius Amado Alves
2005-05-18  7:53                     ` Interfaces Dmitry A. Kazakov
2005-05-18 16:57 ` Interfaces adam
2005-05-20  5:31 ` Interfaces Matthew Heaney
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox