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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,87557ce53b069315 X-Google-Attributes: gid103376,public From: Tucker Taft Subject: Re: meaning of "current instance" Date: 1999/11/11 Message-ID: <382B4CA2.8E7A38A7@averstar.com>#1/1 X-Deja-AN: 547528426 Content-Transfer-Encoding: 7bit Sender: news@inmet.camb.inmet.com (USENET news) X-Nntp-Posting-Host: houdini.burl.averstar.com References: <382b0da1_2@news1.prserv.net> <382b4668_4@news1.prserv.net> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Organization: AverStar (formerly Intermetrics) Burlington, MA USA Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-11-11T00:00:00+00:00 List-Id: 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