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,1116ece181be1aea X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-09-22 08:26:41 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!newspump.monmouth.com!newspeer.monmouth.com!nntp.abs.net!ash.uu.net!spool.news.uu.net!not-for-mail Date: Mon, 22 Sep 2003 11:26:39 -0400 From: Hyman Rosen User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5b) Gecko/20030917 Thunderbird/0.3a X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Is the Writing on the Wall for Ada? References: <568ede3c.0309160929.1d0d3d95@posting.google.com> <3F67AFB9.7040001@attbi.com> <3F6F0841.60607@attbi.com> In-Reply-To: <3F6F0841.60607@attbi.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Organization: KBC Financial Products Message-ID: <1064244399.683441@master.nyc.kbcfp.com> Cache-Post-Path: master.nyc.kbcfp.com!unknown@aphelion.nyc.kbcfp.com X-Cache: nntpcache 3.0.1 (see http://www.nntpcache.org/) NNTP-Posting-Host: 204.253.250.10 X-Trace: 1064244399 21122 204.253.250.10 Xref: archiver1.google.com comp.lang.ada:42749 Date: 2003-09-22T11:26:39-04:00 List-Id: Robert I. Eachus wrote: > No, it is not a moot point in Ada. I still don't think we're talking about the same thing. Suppose we have the following C++ situation: I have two class types, IFoo and IBar, that are not under my control (they come from two separate libraries, perhaps). I am given a container of pointers to IFoo. Since C++ has MI, it's possible that some of these IFoo pointers are actually pointers to objects of a class which inherit both from IFoo and IBar. Such a class can be created independently of the definitions of IFoo and IBar. In any case, I do not have access to the definitions or names of such classes, and at the time I am given the following task, such classes may not even exist yet. I am tasked with finding such IFoo+IBar pointers in the container and handing them off to a procedure which expects to get IBar pointers. In C++, the solution is simple - given an IFoo pointer, I call dynamic_cast on the pointer. If the result is non-null, then I have a valid IBar pointer, and I know that the underlying object inherits from both. So, does Ada have an equivalent to this? Remember, you do not control IFoo, IBar, the container type, or the implementation of the type which is trying to be the combination of an IFoo and an IBar.