isKindOf: vs. isClassX methods

Ivan Tomek ivan.tomek at acadiau.ca
Thu Oct 11 12:08:29 UTC 2001


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):

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.

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?

I will happily change my ways if you show me a better approach.

Ivan

> -----Original Message-----
> From: Andreas Raab [mailto:Andreas.Raab at gmx.de]
> Sent: Thursday, October 11, 2001 12:04 AM
> To: squeak-dev at lists.squeakfoundation.org; 'Eddie Cottongim'
> Subject: RE: isKindOf: vs. isClassX methods
> 
> > 
> The reason is simply that you are *never* interested in the 
> type (e.g.,
> class) of the argument. All you are ever interested in is either its
> interface (e.g., the set of supported protocols) or its role in the
> simulation (which usually comes down to a subset of protocols).
> > >
> 
> 
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20011011/a090fc2c/attachment.htm


More information about the Squeak-dev mailing list