From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7a180be12347b9d3 X-Google-Attributes: gid103376,public X-Google-Thread: 1108a1,7a180be12347b9d3 X-Google-Attributes: gid1108a1,public X-Google-ArrivalTime: 2002-02-13 11:56:38 PST From: brangdon@cix.co.uk (Dave Harris) Newsgroups: comp.lang.ada,comp.object Subject: Re: Merits of re-dispatching [LONG] Date: Wed, 13 Feb 2002 19:58 +0000 (GMT Standard Time) Message-ID: References: <3c68ceeb.88774578@News.CIS.DFN.DE> Reply-To: brangdon@cix.co.uk NNTP-Posting-Host: pc2-clif3-0-cust11.not.cable.ntl.com (80.4.39.11) X-Trace: fu-berlin.de 1013630196 49035660 80.4.39.11 (16 [57443]) Path: archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!isdnet!proxad.net!feed.ac-versailles.fr!fu-berlin.de!uni-berlin.de!pc2-clif3-0-cust11.not.cable.ntl.COM!not-for-mail Xref: archiver1.google.com comp.lang.ada:19973 comp.object:34311 Date: 2002-02-13T19:58:00+00:00 List-Id: 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."