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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!nntp-feed.chiark.greenend.org.uk!ewrotcd!reality.xs3.de!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: A bad counterintuitive behaviour of Ada about OO Date: Fri, 8 Aug 2014 17:26:18 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <932kntuq5rrr.8sumwibqrufn.dlg@40tude.net> <1ohy7vnbntskq$.h139ov04mlxu$.dlg@40tude.net> <536e35d6-f1de-4917-9300-26d78686eaf2@googlegroups.com> <1w3wuhu3d4nxi$.qluzbi0gtlxx$.dlg@40tude.net> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: loke.gir.dk 1407536778 20956 69.95.181.76 (8 Aug 2014 22:26:18 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Fri, 8 Aug 2014 22:26:18 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Xref: news.eternal-september.org comp.lang.ada:21591 Date: 2014-08-08T17:26:18-05:00 List-Id: "Maciej Sobczak" wrote in message news:e1a445fa-b3b8-4b3d-a856-3e0ccbc737bf@googlegroups.com... W dniu piatek, 8 sierpnia 2014 10:14:27 UTC+2 uzytkownik Dmitry A. Kazakov napisal: >> I still do not understand the example. > >http://en.wikipedia.org/wiki/Covariant_return_type > >> Is the operation in question >> primitive for both the factory and product hierarchy? That is MD. > >I don't consider it to be an example of MD, because the two types (factory >and product) >do not play equal roles in the dispatch. Namely, the operation is expected >to dispatch on >the factory type only. That''s not how Ada looks at things (as I'm sure you know). The result type participates in resolution and can participate in dispatch. Ergo, if an operation is primitive on multiple tagged types, then it is by definition MD. Almost all other languages do not have the result type participate in resolution (and thus it makes no sense for it to participate in dispatch). This is a fundemental difference of Ada that clearly is unchangable at this point (we're not going to break thousands of programs that use return type resolution to meet someone's idea of language purity). Randy.