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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,35b23727c41f3e62 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-07-30 15:08:04 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!logbridge.uoregon.edu!uunet!sea.uu.net!ash.uu.net!spool0902.news.uu.net!not-for-mail Date: Tue, 30 Jul 2002 18:10:18 -0400 From: Hyman Rosen User-Agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.1b) Gecko/20020721 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Multiple interface inheritance workaround in Ada 95 / Ada 0x to satisfy a Java language advocate? References: <1028042914.262359@master.nyc.kbcfp.com> <3D46CE25.5010102@worldnet.att.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Organization: KBC Financial Products Message-ID: <1028066881.847132@master.nyc.kbcfp.com> Cache-Post-Path: master.nyc.kbcfp.com!unknown@mosquito.nyc.kbcfp.com X-Cache: nntpcache 3.0.1 (see http://www.nntpcache.org/) NNTP-Posting-Host: 204.253.250.10 X-Trace: 1028066882 256 204.253.250.10 Xref: archiver1.google.com comp.lang.ada:27501 Date: 2002-07-30T18:10:18-04:00 List-Id: Robert A Duff wrote: > I would like to see an example of why it is wanted. On the face of it, > it seems weird to reach off into the far distance and ask whether this > thing I have my hands on just *happens* to obey some totally unrelated > interface. In C++, it's just a part of RTTI (run-time type inquiry). I imagine it's used mostly in "interface discovery" contexts. That is, you have a pointer to an interface, and you want to know whether the underlying object supports other, possibly related interfaces. So you do the cast, and if returns a non-null value, you know the interface is supported. Both COM and CORBA have very similar concepts.