From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Overriding puzzle
Date: Thu, 31 Dec 2015 09:42:03 +0100
Date: 2015-12-31T09:42:03+01:00 [thread overview]
Message-ID: <n62ppb$q70$1@speranza.aioe.org> (raw)
In-Reply-To: dek6taF5o9dU1@mid.individual.net
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
next prev parent reply other threads:[~2015-12-31 8:42 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-30 14:49 Overriding puzzle gautier_niouzes
2015-12-30 15:10 ` Egil H H
2015-12-30 17:31 ` gautier_niouzes
2015-12-30 18:07 ` marciant
2015-12-30 18:24 ` gautier_niouzes
2015-12-30 21:40 ` marciant
2015-12-30 23:10 ` Randy Brukardt
2015-12-31 8:22 ` Niklas Holsti
2015-12-31 8:42 ` Dmitry A. Kazakov [this message]
2016-01-03 7:18 ` Randy Brukardt
2015-12-31 16:30 ` marciant
2015-12-30 23:13 ` Randy Brukardt
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox