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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no 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!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Your wish list for Ada 202X Date: Fri, 11 Apr 2014 08:40:33 +0200 Organization: cbb software GmbH Message-ID: <16388p09ph28u$.1mglp0rm7pli9$.dlg@40tude.net> References: <7f1c01c5-3563-4b94-9831-152dbbf2ecdc@googlegroups.com> <8bhozh836pyt$.1qctlysud0s2q$.dlg@40tude.net> <1cdsyxjzsfgzm.1synpaujysv21$.dlg@40tude.net> <1aa804jg9qq4o$.wdiq33yo621l.dlg@40tude.net> <1w6eh0aiksmdh$.1h16p7y0b8c6h.dlg@40tude.net> <17twpp4p8u7o$.1idvzaaio4f3t$.dlg@40tude.net> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: AuYlnUSfTZrfhAkRjyySpQ.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:19242 Date: 2014-04-11T08:40:33+02:00 List-Id: On Thu, 10 Apr 2014 17:39:39 -0500, Randy Brukardt wrote: > "Dmitry A. Kazakov" wrote in message > news:17twpp4p8u7o$.1idvzaaio4f3t$.dlg@40tude.net... >> On Wed, 9 Apr 2014 22:28:36 -0500, Randy Brukardt wrote: > ... >>>> Ada has no support for dynamic linking anyway, so it is how it is right >>>> now. Introducing MD won't make bad any worse. >>> >>> MD isn't the problem; preference rules are the problem. >> >> That requires a proof which shows that no set of rules can exist that >> fulfills the requirements X, Y, Z. So far it is word against word. Not >> even X, Y, Z is formulated. > > Actually, there was such a formal proof constructed during the design of Ada > 9x. Unfortunately, that's pretty much all I remember about it, so it's not > much help in this discussion. > > But it's quite clear that (sane) preference rules cause Beaujolias. > > Consider an expression node for which two choices (let's call them A and B) > remain after eliminating obvious mismatches. (This situation can be common > when literals are involved, as they match so many types). Ada of course > makes the expression illegal in this case, specifically to avoid Beaujolias. > > But let's consider a preference rule instead. The rule choses A over B, and > then the program is legal and runs. > > Now consider adding another operation C in some package that's referenced by > the semantic closure ("with" in Ada) of our expression. Assume that C also > is a possible choice for our expression node. If the preference rule picks C > rather than A (or picks B for that matter), then we have the classic > Beaujolias scenario when a legal program does something different because an > operation is added to an unrelated package. Your example refers to overloading possible for operations on unrelated types. I don't see how this is scenario could be possible for a primitive MD operation. One of the requirements put on MD is that *all* combinations of tags up to the root of the inheritance tree be defined and checked at compile time. This requirement automatically precludes appearance of C from air. It cannot be primitive and thus the preference rules would not apply to it. This requirement is actually a problem of MD, I don't know how to solve, i.e. how to stretch a hierarchy across several packages. Let two packages define two types P and Q and a cross operation F between. When in a third package R gets derived from P, then how and where we define F for R and Q, provided this third package may know nothing about the package of Q. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de