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, PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,1e3f2eac5c026e3 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-01-05 02:05:00 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!oleane.net!oleane!nnrp.oleane.net!skymaster!nobody From: "Jean-Pierre Rosen" Newsgroups: comp.lang.ada Subject: Re: SIGada Conference Date: Mon, 5 Jan 2004 10:19:30 +0100 Organization: Adalog Message-ID: References: <1071613043.278647@master.nyc.kbcfp.com> <5f5qrb.0un.ln@skymaster> <1071687303.254780@master.nyc.kbcfp.com> NNTP-Posting-Host: mailhost.axlog.fr X-Trace: s1.read.news.oleane.net 1073296878 15789 195.25.228.57 (5 Jan 2004 10:01:18 GMT) X-Complaints-To: abuse@oleane.net NNTP-Posting-Date: Mon, 5 Jan 2004 10:01:18 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Xref: archiver1.google.com comp.lang.ada:4116 Date: 2004-01-05T10:19:30+01:00 List-Id: "Hyman Rosen" a �crit dans le message de news:1071687303.254780@master.nyc.kbcfp.com... > Jean-Pierre Rosen wrote: > > "Hyman Rosen" a �crit > >>I expect this is just the usual "simulate MI with access discriminants" > >>bit that always comes up here. I think it can do everything except support > >>cross-casting. > > > > It can. See my paper at http://www.adalog.fr/publicat/ada-interfaces.pdf > > Does this mean that you think it can support cross-casting, > or do you agree that it cannot? That is, in Java, I may have > two interfaces: > interface IF_1 { } interface IF_2 { } > and given an object of type IF_1, I may try to see if it is > also of type IF_2: > boolean is_both(IF_1 o) { return o instanceof IF_2; } > and if it is, I can cross-cast: > IF_2 as_IF_2(IF_1 o) { return is_both(o) ? (IF_2)o : null; } > > Note that I can do this without any knowledge at all of the > existence of one or more parent types which implement both > interfaces. I don't think this can be done with the inner class/ > access discriminant approach. > What I meant is that if class A implements interface IF, and you get an object as an IF, you can get a view of it as an A. I didn't consider the case you mention - presumably because I never met a need for it! -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Visit Adalog's web site at http://www.adalog.fr