<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2653.12">
<TITLE>RE: isKindOf: vs. isClassX methods</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=2>I would say 'never say never' (especially not *never*). I think that the following shows that sometimes I need to know (unnecessarily complex, but a real example):</FONT></P>

<P><FONT SIZE=2>In VisualWorks, I want to create a tool for editing hot keys (Ctrl t, ESC b, etc.), The way this works in VW is that there is a dispatch table with, essentially, two dictionaries. The first contains Ctrl key combinations and some special entries, the other ESC combinations.</FONT></P>

<P><FONT SIZE=2>I would like to display the Ctrl combinations from the first dictionary to allow the user to manipulate them. So I must extract from this dictionary those associations that have Character keys. How am I supposed to do that without either asking the key for its class, isKindOf: isMemberOf:, or writing an isCharacter?</FONT></P>

<P><FONT SIZE=2>I will happily change my ways if you show me a better approach.</FONT>
</P>

<P><FONT SIZE=2>Ivan</FONT>
</P>

<P><FONT SIZE=2>&gt; -----Original Message-----</FONT>
<BR><FONT SIZE=2>&gt; From: Andreas Raab [<A HREF="mailto:Andreas.Raab@gmx.de">mailto:Andreas.Raab@gmx.de</A>]</FONT>
<BR><FONT SIZE=2>&gt; Sent: Thursday, October 11, 2001 12:04 AM</FONT>
<BR><FONT SIZE=2>&gt; To: squeak-dev@lists.squeakfoundation.org; 'Eddie Cottongim'</FONT>
<BR><FONT SIZE=2>&gt; Subject: RE: isKindOf: vs. isClassX methods</FONT>
<BR><FONT SIZE=2>&gt; </FONT>
<BR><FONT SIZE=2>&gt; &gt; </FONT>
<BR><FONT SIZE=2>&gt; The reason is simply that you are *never* interested in the </FONT>
<BR><FONT SIZE=2>&gt; type (e.g.,</FONT>
<BR><FONT SIZE=2>&gt; class) of the argument. All you are ever interested in is either its</FONT>
<BR><FONT SIZE=2>&gt; interface (e.g., the set of supported protocols) or its role in the</FONT>
<BR><FONT SIZE=2>&gt; simulation (which usually comes down to a subset of protocols).</FONT>
<BR><FONT SIZE=2>&gt; &gt; &gt;</FONT>
<BR><FONT SIZE=2>&gt; </FONT>
<BR><FONT SIZE=2>&gt; </FONT>
<BR><FONT SIZE=2>&gt; </FONT>
</P>

</BODY>
</HTML>