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!mx02.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Overriding puzzle Date: Thu, 31 Dec 2015 09:42:03 +0100 Organization: Aioe.org NNTP Server Message-ID: References: <5be84c5a-9614-4ee2-ae85-beb962171a05@googlegroups.com> <192c4493-9c53-4e23-b9bd-e4c543738dbc@googlegroups.com> <26e20ae9-ad86-4c88-9c67-f1a4a9b33f23@googlegroups.com> <677d0956-63d3-4de8-a6e5-b79c52a1dc12@googlegroups.com> NNTP-Posting-Host: LNA1TkTuMxfwTHzeJdi6nA.user.speranza.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 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:28949 Date: 2015-12-31T09:42:03+01:00 List-Id: On 2015-12-31 09:22, Niklas Holsti wrote: > On 15-12-31 01:10 , Randy Brukardt wrote: >> The model of Ada is that within a routine (including inherited routines) the >> object acts as if it had the named type. This makes it much easier to reason >> about the routine, as the behavior of all of the routines called is >> known. >> >> When you redispatch, you no longer can reason in any useful way about the >> behavior of the call -- essentially you are depending on "magic" (and the >> competency of others) to get the right answer. In limited circumstances >> (like the OP), it works well, but for general programming, look out! > > The same (IMO a bit paranoid) argument would logically apply to all > dispatching calls, including dispatching calls from class-wide subprograms. A class-wide subprogram is declared class-wide = for all types from the class. > The conclusion would be that one cannot reason in any useful way about > any dispatching call. One can. The issue is about the types the reasoning should apply. You cannot reason about specific types when you potentially re-dispatch away from the specific type stated. But you still can reason about a subclass of types even if you dispatch no some of them, unknown in advance. The point is that IF you are going dispatch THEN, please, state your intention in a well-typed way. Happy New Year! -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de