Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!uunet!microsoft!jimad From: jimad@microsoft.UUCP (Jim ADCOCK) Newsgroups: comp.lang.c++ Subject: Re: asking an object for its type Message-ID: <71199@microsoft.UUCP> Date: 11 Mar 91 20:05:47 GMT References: <70902@microsoft.UUCP> <6900@mace.cc.purdue.edu> <71034@microsoft.UUCP> <27D572F6.2A70@tct.uucp> Reply-To: jimad@microsoft.UUCP (Jim ADCOCK) Organization: Microsoft Corp., Redmond WA Lines: 17 In article <27D572F6.2A70@tct.uucp> chip@tct.uucp (Chip Salzenberg) writes: |According to jimad@microsoft.UUCP (Jim ADCOCK): |>...what is really needed is neither the ability to test whether an |>object supports some particular method, nor the ability to test whether |>an object is some exact type, but rather, what is needed is the ability |>to test whether an object supports some particular protocol. | |Even that isn't enough. Two unrelated types can both implement "void |foo(int)". That doesn't mean that the two foos are equivalent. The |"isKindOf" test is the minimum for reasonable dynamic typing in the |C++ type forest. I think you and I have different meanings for "protocol." You seem to use "protocol" to mean the signature of one method. I use "protocol" to mean that an object has to support a *set* of methods correctly matching both in signature and meaning. Thus, I think your call for an "isKindOf" test is the same requirement as I'm calling for.