comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: overriding in private part
Date: Thu, 2 Oct 2008 18:17:28 -0500
Date: 2008-10-02T18:17:28-05:00	[thread overview]
Message-ID: <gc3l4p$sr$1@jacob-sparre.dk> (raw)
In-Reply-To: 45b4a4cc-13f5-4175-9061-9c962e32d762@64g2000hsm.googlegroups.com

"Maxim Reznik" <reznikmm@gmail.com> wrote in message 
news:45b4a4cc-13f5-4175-9061-9c962e32d762@64g2000hsm.googlegroups.com...
...
> Every type in class A1.Base'Class has P2 primitive subprogram, but any
> child of A2.Child can't override it, because P2 is hidden by A2.P2. It
> seems unnatural to me.
>
> Errors of such kind are very difficult to find.
>
> Is there any way to prevent such errors? (Besides keyword
> *overriding*)

This happened to us frequently when we were building Claw. That's the reason 
I pushed so hard to add what became the keywords to the language. It's an 
error that cannot be avoided or detected in Ada 95 (short of avoiding any 
declarations in private parts, which is nasty). It is very hard to predict 
what really is going to happen, so the keywords allow telling the compiler 
what you meant (and then it will complain if it disagrees).

If you can't use new Ada features, you are SOL. Sorry.

                                               Randy.





      parent reply	other threads:[~2008-10-02 23:17 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
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 [this message]
replies disabled

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