comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Equivalent of dynamic_cast (downcast) for tagged types
Date: Sat, 29 Jan 2011 09:47:04 +0100
Date: 2011-01-29T09:47:05+01:00	[thread overview]
Message-ID: <14jd18jvu7lv5$.fbnn6azbxr7e$.dlg@40tude.net> (raw)
In-Reply-To: ihvm19$6in$1@munin.nbi.dk

On Fri, 28 Jan 2011 18:12:20 -0600, Randy Brukardt wrote:

> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message 
> news:1phnecgw6ckgv.1vm12emlufu5b.dlg@40tude.net...
> ...
>> Yes, it is wrong (language design). The operation is primitive even if
>> invisible in *some* contexts. It means that there might exist other
>> contexts where two operations would conflict. Furthermore, Ada designers
>> tried (and expectedly failed) to ensure that "multiple inheritance" always
>> override.
> 
> I have no idea as to what you are talking about here.

I mean that the issues, MI is customary accused of, are common and
unavoidable with or without MI.

> IMHO, MI is a 
> large cannon whose primary purpose is to blow off limbs.

Nope, MI is an important software development tool for refactoring and
reuse. My current project's size could be reduced in a third, if Ada had
MI.

> Remember that a lot more goes into what is overriding than just the names of 
> operations; it also depends on the profiles and visibility.

But the core issue is always same: the choice between overloading vs.
overriding.

> And, regardless of whether there is a language design flaw, there is no 
> chance that this would change. It would break too much existing code. 

I don't think so, because the means to control the choice are just absent.
Clearly there should be some syntax additions to specify the behavior. So
far the only one is the keyword "overriding."

Also there must be means to resolve unavoidable conflicts. Each overloaded
item should have a unique name. Furthermore, the primitive operations
should have names (presently the names of their type-specific instances are
used in an ambiguous manner).

> Moreover, I think that what you are talking about is actively harmful. Claw, 
> for instance, uses the current rules to have implementation operations that 
> are dispatching, but that clients cannot override in any circumstances. (If 
> they did, Claw would likely fall over in a heap, causing a debugging and 
> support nightmare.)

I am talking about the reality, the reality hurts, I know (:-)). BTW, I am
not proposing to change the current language behavior. I want new language
means to be able to *describe* this behavior explicitly and same means to
describe the alternative behavior where I wanted.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



  reply	other threads:[~2011-01-29  8:47 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-27 15:46 Equivalent of dynamic_cast (downcast) for tagged types Maciej Sobczak
2011-01-27 16:18 ` Dmitry A. Kazakov
2011-01-27 17:10   ` J-P. Rosen
2011-01-27 17:35     ` Dmitry A. Kazakov
2011-01-27 22:49     ` Maciej Sobczak
2011-01-27 17:50   ` Georg Bauhaus
2011-01-27 22:35   ` Maciej Sobczak
2011-01-28  5:07     ` Yannick Duchêne (Hibou57)
2011-01-28  9:16     ` Dmitry A. Kazakov
2011-01-28 13:11       ` AdaMagica
2011-01-28 14:13         ` Dmitry A. Kazakov
2011-01-28 23:51           ` Randy Brukardt
2011-01-29  0:55             ` Adam Beneschan
2011-01-28 16:44       ` Adam Beneschan
2011-01-28 17:21         ` Dmitry A. Kazakov
2011-01-29  0:12           ` Randy Brukardt
2011-01-29  8:47             ` Dmitry A. Kazakov [this message]
2011-01-28 17:33         ` Adam Beneschan
2011-01-28 15:13     ` Maciej Sobczak
2011-01-28 17:47       ` Robert A Duff
2011-01-28 22:04         ` Maciej Sobczak
2011-01-30 20:22           ` Stephen Leake
2011-01-31  9:04             ` AdaCore, user community and communication channels Maciej Sobczak
2011-01-31 10:42               ` Georg Bauhaus
2011-01-27 19:33 ` Equivalent of dynamic_cast (downcast) for tagged types Adam Beneschan
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox