From: Stephen Leake <stephen.a.leake.1@gsfc.nasa.gov>
Subject: Re: Renaming an abstract function
Date: 23 Nov 2001 10:40:02 -0500
Date: 2001-11-23T15:42:54+00:00 [thread overview]
Message-ID: <uwv0hlcml.fsf@gsfc.nasa.gov> (raw)
In-Reply-To: 9tht9c$2j1ni$2@ID-25716.news.dfncis.de
"Nick Roberts" <nickroberts@adaos.worldonline.co.uk> writes:
> "Stephen Leake" <stephen.a.leake.1@gsfc.nasa.gov> wrote in message
> > ...
> > Well, the full text of the AI talks about renaming an _inherited_
> > subprogram, not the abstract subprogram itself. It does not discuss
> > exactly what should happen for this case.
>
> Precisely my point (in parallel post).
>
> > Simply following the rules for inheriting abstract subprograms, you
> > are required to give an overriding subprogram for any derived type.
> > Thus, if the renaming is valid, you'd have to override both P and "*",
>
> This is correct.
>
> > which is surely not the intent.
>
> Yes it is the intent. The Rationale (8.3) makes this clear.
Well, I meant the "intent of the programmer". If I rename a function,
I "intend" to have two names for one function. If, when deriving the
type, I must provide _two_ functions, that is not two names for _one_
function. Of course, I can provide the same function, but I'd prefer
the language to enforce it.
Rationale 8.3 does say the behavior of renamed primitive operations
"may be considered surprising". I guess that's all I'm saying; I find
the behavior of inherited renamed primitive operations surprising. But
having read the Rationale (something I should do more often), I can
see why it has to be this way.
> > So it seems reasonable to conclude that the renaming itself is
> > invalid.
>
> No, I don't think so.
Right, this is pretty close to the example in the rationale.
> > We could propose a "renaming inheritance" rule that says an
> > equivalent renaming is applied to the overriding subprogram; that
> > is the intent of this renaming.
>
> Intriguing idea, but it is already laid down: the renaming creates a new
> 'slot', thus both (the original and renamed) subprograms can be (and, in the
> case of an asbtract subprogram, would need to be) overridden separately.
Yes, but the Rationale doesn't specifically address inheriting a
renamed function. It would be good if it did.
--
-- Stephe
next prev parent reply other threads:[~2001-11-23 15:40 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-11-15 23:52 Renaming an abstract function Nick Roberts
2001-11-16 14:52 ` Stephen Leake
2001-11-17 3:08 ` Adam Beneschan
2001-11-17 17:47 ` Egil Harald Hoevik
2001-11-17 18:33 ` Stephen Leake
2001-11-17 22:00 ` Mark Biggar
2001-11-17 23:17 ` Nick Roberts
2001-11-19 15:38 ` Stephen Leake
2001-11-22 3:14 ` Nick Roberts
2001-11-23 15:40 ` Stephen Leake [this message]
2001-11-24 3:55 ` Nick Roberts
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox