comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: How to hide inherited implementation of a public interface?
Date: Fri, 21 Mar 2014 18:02:28 -0500
Date: 2014-03-21T18:02:28-05:00	[thread overview]
Message-ID: <lgige4$3oh$1@loke.gir.dk> (raw)
In-Reply-To: 1goz7i2pg8860.1kma3d5vz1fl$.dlg@40tude.net

"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message 
news:1goz7i2pg8860.1kma3d5vz1fl$.dlg@40tude.net...
> On Fri, 21 Mar 2014 10:58:54 -0700, Jeffrey Carter wrote:
>
>> On 03/21/2014 05:53 AM, Natasha Kerensikova wrote:
>>>
>>>     package I is
>>>        type T is interface;
>>>        procedure P (Object : in out T) is abstract;
>>>     end I;
>>
>> "IMHO, Interfaces are worthless."
>
> Interface is an abstract type. Abstract types are not worthless.
>
> Worthless is the Java's idea that multiple inheritance could become more
> useful, less flawed, choose what you want, when restricted to interfaces.

Exactly. "Abstract types" (which can have components, implementations, etc.) 
are not worthless. The restrictions on interfaces make them worth little. 
("Worthless" is going a bit far, of course, but it makes a good sound bite.) 
The costs of multiple inheritance (which are considerable) make them not 
worth the effort.

Full multiple inheritance CAN be implemented, but it's expensive enough in 
compiler and language complexity that the costs outweight the value. The 
halfway Java-like solution is easier to implement but makes no one happy. We 
should have told the multiple inheritance nuts to forget it, because it 
makes no sense for Ada.

                                                      Randy.




  reply	other threads:[~2014-03-21 23:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-21 12:53 How to hide inherited implementation of a public interface? Natasha Kerensikova
2014-03-21 13:54 ` Dmitry A. Kazakov
2014-03-21 16:05   ` Natasha Kerensikova
2014-03-21 17:58 ` Jeffrey Carter
2014-03-21 20:14   ` Dmitry A. Kazakov
2014-03-21 23:02     ` Randy Brukardt [this message]
2014-03-22  8:31       ` Dmitry A. Kazakov
replies disabled

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