From: Tucker Taft <stt@averstar.com>
Subject: Re: meaning of "current instance"
Date: 1999/11/11
Date: 1999-11-11T00:00:00+00:00 [thread overview]
Message-ID: <382B4CA2.8E7A38A7@averstar.com> (raw)
In-Reply-To: 382b4668_4@news1.prserv.net
Matthew Heaney wrote:
> ...
> > But I don't see what the type of the expression T'Access has to do with
> > it, so perhaps I'm misunderstanding your question.
>
> Perhaps I stated my question incorrectly.
>
> I do not care about the type of the expression T'Access.
>
> I do care about the type of the object designated by the access object
> returned by T'Access.
>
> I care because I want to call an operation that dispatches on the tag of
> the designated object:
>
> function Init (O : access T'Class) return Integer is
> begin
> return Do_Init (O);
> end;
>
> where Do_Init is a (private) primitive operation:
>
> function Do_Init (O : access T) return Integer;
>
> For object O1 (of type T), I want T's Do_Init to be called.
>
> For object O2 (of type NT), I want NT's Do_Init to be called.
You should probably be saying "with tag NT" rather than "of type NT."
For dispatching, the "type" (which is basically a compile-time concept)
is not particularly important, so long as it is class-wide.
What matters is the "tag" (which is fundamentally a run-time concept).
At least when talking to Bob and I ;-), it would behoove you
to reserve the term "type" for the compile-time view of the object,
and the term "tag" for the relevant run-time characteristics.
Another way to be clear is to say the "run-time type" or even
the "underlying run-time type" but that is pretty much what
"tag" means, so why not use that nice 3-letter word?
>
> My compiler calls T's Do_Init for both O1 and O2.
Sounds like a bug, though I haven't personally analyzed the
situation in depth (it seems like Bob did...).
-Tuck
--
-Tucker Taft stt@averstar.com http://www.averstar.com/~stt/
Technical Director, Distributed IT Solutions (www.averstar.com/tools)
AverStar (formerly Intermetrics, Inc.) Burlington, MA USA
next prev parent reply other threads:[~1999-11-11 0:00 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-11-11 0:00 meaning of "current instance" Matthew Heaney
1999-11-11 0:00 ` Robert A Duff
1999-11-11 0:00 ` Matthew Heaney
1999-11-11 0:00 ` Tucker Taft [this message]
1999-11-15 0:00 ` Tucker Taft
1999-11-15 0:00 ` tmoran
1999-11-15 0:00 ` Tucker Taft
1999-11-11 0:00 ` tmoran
1999-11-11 0:00 ` Matthew Heaney
1999-11-12 0:00 ` tmoran
1999-11-11 0:00 ` Matthew Heaney
1999-11-12 0:00 ` tmoran
1999-11-12 0:00 ` Matthew Heaney
1999-11-12 0:00 ` tmoran
1999-11-12 0:00 ` Matthew Heaney
1999-11-13 0:00 ` Robert A Duff
1999-11-13 0:00 ` Nick Roberts
1999-11-13 0:00 ` Robert A Duff
1999-11-14 0:00 ` tmoran
1999-11-13 0:00 ` Matthew Heaney
1999-11-15 0:00 ` John English
1999-11-15 0:00 ` Matthew Heaney
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox