From: brangdon@cix.co.uk (Dave Harris)
Subject: Re: Merits of re-dispatching [LONG]
Date: Wed, 13 Feb 2002 19:58 +0000 (GMT Standard Time)
Date: 2002-02-13T19:58:00+00:00 [thread overview]
Message-ID: <memo.20020213195841.65507A@brangdon.madasafish.com> (raw)
In-Reply-To: 3c68ceeb.88774578@News.CIS.DFN.DE
dmitry@elros.cbb-automation.de (Dmitry A. Kazakov) wrote (abridged):
> That is one of several possible interpretation of what happens in C++
> using Ada terms. However, I prefer mine, because it is consistent with
> the fact that the type tag [= vtab] is constant, thus the actual
> specific type is also constant.
> [...]
> When you pass it to some other routine an implicit specific->class
> wide conversion happens, so the routine can dispatch again.
This doesn't work. If you look at the 3 calls to call_foo() in Hyman
Rosen's example, you'll see it dispatches to 3 different places. Therefore
we cannot view the object has having a constant type with 2 kinds of
dispatching. A specific->class-wide conversion would have it printing
C::foo 2 or 3 times. Your view doesn't match the visible behaviour.
If you think in terms of a conversion, the different calls to call_foo()
must convert to different types. It's not enough to switch the vtable on
and off, you need different conceptual vtables.
Given this, its simpler to think of the conversion as happening as soon as
the constructor is entered, rather than when the constructor calls out.
> An Ada 95 equivalent would be:
Your example only shows 2 types, so doesn't capture the richness of
behaviour of Hyman's example which has 3. I suspect you have misunderstood
it.
Dave Harris, Nottingham, UK | "Weave a circle round him thrice,
brangdon@cix.co.uk | And close your eyes with holy dread,
| For he on honey dew hath fed
http://www.bhresearch.co.uk/ | And drunk the milk of Paradise."
next prev parent reply other threads:[~2002-02-13 19:58 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-02-07 10:26 Merits of re-dispatching [LONG] Dmitry A. Kazakov
2002-02-07 15:03 ` Hyman Rosen
2002-02-08 1:29 ` Matthew Heaney
2002-02-08 9:16 ` Dmitry A. Kazakov
2002-02-08 18:30 ` Hyman Rosen
2002-02-09 0:10 ` Matthew Heaney
2002-02-12 8:32 ` Dmitry A. Kazakov
2002-02-12 21:37 ` Hyman Rosen
2002-02-13 9:29 ` Dmitry A. Kazakov
2002-02-13 14:32 ` Hyman Rosen
2002-02-13 19:58 ` Dave Harris [this message]
2002-02-14 15:06 ` Dmitry A. Kazakov
2002-02-16 12:10 ` Dave Harris
2002-02-18 8:57 ` Dmitry A. Kazakov
2002-02-18 19:47 ` Merits of re-dispatching Dave Harris
2002-02-19 9:20 ` Dmitry A. Kazakov
2002-02-21 5:49 ` Hyman Rosen
2002-02-21 9:04 ` Dmitry A. Kazakov
2002-02-21 18:17 ` Hyman Rosen
2002-02-22 9:21 ` Dmitry A. Kazakov
2002-02-22 16:59 ` Hyman Rosen
2002-02-25 8:51 ` Dmitry A. Kazakov
2002-02-08 23:51 ` Merits of re-dispatching [LONG] Matthew Heaney
2002-02-12 9:02 ` Dmitry A. Kazakov
2002-02-07 23:40 ` Nick Roberts
2002-02-08 8:56 ` Dmitry A. Kazakov
2002-02-08 1:06 ` Matthew Heaney
2002-02-08 9:48 ` Dmitry A. Kazakov
2002-02-09 0:16 ` Matthew Heaney
2002-02-08 18:10 ` Hyman Rosen
2002-02-09 0:41 ` Matthew Heaney
2002-02-08 18:33 ` Nick Roberts
2002-02-09 4:07 ` Nick Roberts
2002-02-12 10:13 ` Dmitry A. Kazakov
2002-02-14 20:57 ` Tucker Taft
2002-02-15 15:43 ` Dmitry A. Kazakov
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox