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-Thread: a07f3367d7,f428ff2031155951 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!news.in2p3.fr!in2p3.fr!news.ecp.fr!news.jacob-sparre.dk!pnx.dk!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Equivalent of dynamic_cast (downcast) for tagged types Date: Fri, 28 Jan 2011 18:12:20 -0600 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <375fb596-ab12-4cb0-a190-53d62b94b2e4@e9g2000vbi.googlegroups.com> <510d779c-d15b-4fc1-b831-bfc578ecdb4b@z3g2000prz.googlegroups.com> <7q5flc9of9ey.19h9nmmzjxqn0.dlg@40tude.net> <242e5c66-04cf-46a0-ae33-5f4d70946b51@l22g2000pre.googlegroups.com> <1phnecgw6ckgv.1vm12emlufu5b.dlg@40tude.net> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1296259945 6743 69.95.181.76 (29 Jan 2011 00:12:25 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Sat, 29 Jan 2011 00:12:25 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5931 X-RFC2646: Format=Flowed; Original Xref: g2news1.google.com comp.lang.ada:16781 Date: 2011-01-28T18:12:20-06:00 List-Id: "Dmitry A. Kazakov" wrote in message news:1phnecgw6ckgv.1vm12emlufu5b.dlg@40tude.net... ... > Yes, it is wrong (language design). The operation is primitive even if > invisible in *some* contexts. It means that there might exist other > contexts where two operations would conflict. Furthermore, Ada designers > tried (and expectedly failed) to ensure that "multiple inheritance" always > override. I have no idea as to what you are talking about here. The inheritance rules haven't changed significantly since Ada 95 (there is a tweak in Ada 2012 which will help alievate this problem when it is unintentional). And multiple inheritance has nothing whatsoever to do with it. IMHO, MI is a large cannon whose primary purpose is to blow off limbs. :-) Don't do it. Remember that a lot more goes into what is overriding than just the names of operations; it also depends on the profiles and visibility. Just thinking about names always gets you into trouble when thinking about Ada. And, regardless of whether there is a language design flaw, there is no chance that this would change. It would break too much existing code. Moreover, I think that what you are talking about is actively harmful. Claw, for instance, uses the current rules to have implementation operations that are dispatching, but that clients cannot override in any circumstances. (If they did, Claw would likely fall over in a heap, causing a debugging and support nightmare.) Randy.