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.1 required=5.0 tests=BAYES_00,LOTS_OF_MONEY, PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,35b23727c41f3e62 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-07-30 07:30:03 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!colt.net!newspeer.clara.net!news.clara.net!oleane.net!oleane!nnrp.oleane.net!not-for-mail From: "Jean-Pierre Rosen" Newsgroups: comp.lang.ada Subject: Re: Multiple interface inheritance workaround in Ada 95 / Ada 0x to satisfy a Java language advocate? Date: Tue, 30 Jul 2002 16:27:06 +0200 Organization: Adalog Message-ID: References: NNTP-Posting-Host: mailhost.axlog.fr X-Trace: s1.read.news.oleane.net 1028039155 17959 195.25.228.57 (30 Jul 2002 14:25:55 GMT) X-Complaints-To: abuse@oleane.net NNTP-Posting-Date: Tue, 30 Jul 2002 14:25:55 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 Xref: archiver1.google.com comp.lang.ada:27483 Date: 2002-07-30T16:27:06+02:00 List-Id: "Hyman Rosen" a �crit dans le message news: fXw19.29303$NX5.1749@nwrddc02.gnilink.net... > Jean-Pierre Rosen wrote: > > It provides a design pattern for providing all the functionnality of Java interfaces > > Including cross-casting? > > That is, in Java (or C++), if I have class C implements I1, I2 > and I have an I1 reference, I can try casting the I1 to an I2, > and if the reference is actually to a C object, the cast works. > > The attempts to simulate MI in Ada by using access discriminants > don't handle this, as far as I know. > Yes. Or more exactly, the design pattern provides functions that allow you to get an I1 or I2 view for a C object, and to go back from an I1 or I2 view back to the original C object. And you are correct that this is not obvious to achieve. That's what prompted me to make a paper of it! -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Visit Adalog's web site at http://www.adalog.fr