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!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Why can't Ada use dot notation on private types? Date: Thu, 9 Feb 2017 09:47:38 +0100 Organization: Aioe.org NNTP Server Message-ID: References: NNTP-Posting-Host: vZYCW951TbFitc4GdEwQJg.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:33282 Date: 2017-02-09T09:47:38+01:00 List-Id: On 09/02/2017 00:26, Randy Brukardt wrote: > "Dmitry A. Kazakov" wrote in message > news:o7am71$13o1$1@gioia.aioe.org... >> On 2017-02-06 20:44, Randy Brukardt wrote: >> >>> The problems mainly come from the possibility of implicit .all and >>> 'Access. >> >> Perfect, why is this a problem? It is just what is needed. I want to >> override "all", so let me do this. > > When elementary types are included in prefix notation, there are potentially > an infinite number of implicit .all or 'Access combinations. A compiler > would have trouble figuring them out (aand it could get *very* expensive), > and a reader would be even more confused. ".all" and "'Access" have an argument and a result. It is a classic MD case. Upon overriding it must be clear that this happens for a given type of the argument (e.g. object type) and a given type of the result (e.g. access type). The compiler can select an implementation in a usual manner and then look if that one has been overridden in the given context. Actual problems are with tagged types, because full MD is not supported. But that is nothing new. User-defined assignment is also a MD operation and Ada's 95 controlled-types kludge does not work right for it either. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de