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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1592759aa83d0d45 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-05-25 07:12:54 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: wojtek@power.com.pl (Wojtek Narczynski) Newsgroups: comp.lang.ada Subject: Re: Suggestion for Ada 200x - Interface inheritance Date: 25 May 2003 07:12:53 -0700 Organization: http://groups.google.com/ Message-ID: <5ad0dd8a.0305250612.ec54c23@posting.google.com> References: <0Pxza.699607$OV.652508@rwcrnsc54> <5ad0dd8a.0305240435.337d9373@posting.google.com> NNTP-Posting-Host: 62.111.211.178 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1053871974 13530 127.0.0.1 (25 May 2003 14:12:54 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 25 May 2003 14:12:54 GMT Xref: archiver1.google.com comp.lang.ada:37759 Date: 2003-05-25T14:12:54+00:00 List-Id: Robert A Duff wrote in message news:... > More than one interface can be inherited. That sounds like "multiple > inheritance" to me. Java interface inheritance is just like C++ muliple > inheritance, with the restriction that you can't inherit record > components and procedure bodies. Usually you implement the interface. This likely comes from the Objective-C ground, where you have 'protocols' (different name, same role, said to be inspiration for Java interfaces). It's pretty natural that you implement a protocol, not inherit a protocol. In the same sense an interface/protocol can implement another interface/protocol. The question boils down to wether an interface is an ancestor of the type which implements (/inherits?) it. I think it is not, and thus prefer to talk about implementing the interface not inheriting it. For examle the USB interface is not an ancestor of my PC. > > But I'll welcome whatever comes out, because the inability to create > > heterogenous collections just plain sucks. > > What do you mean by that? You can pass class-wide types to generic > collection packages, and that's heterogeneous. I guess you mean you > can't do what interface'Class allows... I meant the situation where I needed to store objects from two libraries I could not put a common ancestor above. But I admit it is not the usual case. > > By the way, is there an AI for the second thing Ada could learn from > > Java, that is 'throws' clause? > > I think there's one about pre- and post-conditions, which is somewhat > related. Yeah. Pre- and post-conditions are easier, I guess, because they can't break current code, while the introduction of 'throws' ('raises'?), without some trick, would. Regards, Wojtek