comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: which compiler is right?
Date: Wed, 17 Mar 2004 23:07:34 -0600
Date: 2004-03-17T23:07:34-06:00	[thread overview]
Message-ID: <105iblbigdett75@corp.supernews.com> (raw)
In-Reply-To: b4682ab7.0403170927.cc800a5@posting.google.com

"Adam Beneschan" <adam@irvine.com> wrote in message
news:b4682ab7.0403170927.cc800a5@posting.google.com...
...
> Since the score is currently 2-0 that the code should be illegal,
> maybe I should point out that not everyone agrees with this analysis,
> before you decide it's necessary to fix your code.  My belief is that
> since the Priority routine declared in Pkg2 is declared in a different
> scope than whatever type will be used to instantiate Pkg2, Priority is
> neither a primitive subprogram nor is overriding.  I think GNAT is
> correct to accept the code.

I thought that too, but that's not what the language says. Routines can be
overriding if they are inherited, anywhere. That's so that a type declared
in a body can have overriding routines, even though it can't have
primitives. Scopes have absolutely nothing to do with overriding (look at
8.3 again if you don't believe me). Similarly, primitiveness has nothing to
do with it.

It would be fine for that not to apply in a generic unit, but that is not
the current rule (because the
primitive routines are inherited in the generic). And this is not an area
into which I would likeIn any case, the OP doesn't have any grounds to get
Aonix to change ObjectAda. They may decide to do so because he's an
important customer or something, but otherwise they would be well advised to
wait for the ARG to shake this out.

I think it should be illegal simply because it is very confusing. This looks
like an overriding routine, but it is not. And if it is not overriding,
calls outside of the generic are almost certainly ambigious (for use clause
users, anyway). So it isn't very useful. I suppose the overridding keywords
will help reduce the confusion some, but only if they're widely used (this
routine ought to be tagged "not overriding", which would eliminate the
confusion if that was actually intended. But it would still be hard to call
the routine.)

                   Randy.






  reply	other threads:[~2004-03-18  5:07 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-16 13:44 which compiler is right? Lionel.DRAGHI
2004-03-16 14:56 ` Dmitry A. Kazakov
2004-03-16 23:43 ` Randy Brukardt
2004-03-17 17:27 ` Adam Beneschan
2004-03-18  5:07   ` Randy Brukardt [this message]
2004-03-18 20:33     ` Adam Beneschan
2004-03-19 19:48       ` Randy Brukardt
  -- strict thread matches above, loose matches on Subject: below --
2004-03-17 18:56 Lionel.DRAGHI
2004-03-17 18:53 Lionel.DRAGHI
2004-03-18  4:57 ` Randy Brukardt
2004-03-17 10:16 Lionel.DRAGHI
2004-03-17 17:48 ` Randy Brukardt
2004-03-16 15:35 Lionel.DRAGHI
1997-07-24  0:00 Which compiler is right ? Strategies
1997-07-25  0:00 ` Tucker Taft
1997-07-25  0:00 ` Albert K. Lee
replies disabled

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