comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: overriding in private part
Date: Mon, 6 Oct 2008 18:32:06 -0500
Date: 2008-10-06T18:32:06-05:00	[thread overview]
Message-ID: <gce760$3i7$1@jacob-sparre.dk> (raw)
In-Reply-To: 16aosnc43o0l2.1snh410eman0v$.dlg@40tude.net

"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> wrote in message 
news:16aosnc43o0l2.1snh410eman0v$.dlg@40tude.net...
...
> As for me, I think that overriding could be a good default for all
> subprograms with at least one controlling argument. Declarations of any 
> new
> primitive operation should then be explicit:
>
>   procedure Foo (X : Boo) is [abstract] new; -- I hate "overriding"
>
> Non-primitive operations should be made illegal if any of the arguments is
> controlling:

Yes, that would be the correct semantics if the language was being built 
from scratch. Unfortunately, the Ada 95 team decided to use the existing 
inheritance mechanism, and that isn't quite right. It's not so obvious until 
you try examples in various ways.

In any case, non-primitive routines with specific tagged types are pretty 
suspicious and clearly deserve a warning. (There are a couple of them in 
Claw - mostly functions returning some specific tagged type, but the 
majority are class-wide.)

                                Randy.





  reply	other threads:[~2008-10-06 23:32 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-02 15:49 overriding in private part Maxim Reznik
2008-10-02 16:42 ` Adam Beneschan
2008-10-03  8:52   ` Dmitry A. Kazakov
2008-10-03 15:54     ` Adam Beneschan
2008-10-03 20:29       ` Robert A Duff
2008-10-04  2:28         ` Randy Brukardt
2008-10-04 19:47           ` Robert A Duff
2008-10-05  7:35             ` Dmitry A. Kazakov
2008-10-05 19:57               ` Robert A Duff
2008-10-06  8:50                 ` Dmitry A. Kazakov
2008-10-06 23:32                   ` Randy Brukardt [this message]
2008-10-05 11:46             ` stefan-lucks
2008-10-05 20:08               ` Robert A Duff
2008-10-06 23:39                 ` Randy Brukardt
2008-10-02 23:17 ` 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