<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Feb 4, 2015 at 12:40 PM, Chris Muller <span dir="ltr"><<a href="mailto:asqueaker@gmail.com" target="_blank">asqueaker@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">On Wed, Feb 4, 2015 at 1:12 PM, Chris Muller <<a href="mailto:ma.chris.m@gmail.com">ma.chris.m@gmail.com</a>> wrote:<br>
>> On Wed, Feb 4, 2015 at 9:07 AM, Chris Muller <<a href="mailto:asqueaker@gmail.com">asqueaker@gmail.com</a>> wrote:<br>
>>><br>
>>> isSequenceable is a term that refers to a particular *kind* of<br>
>>> Collection, a sequenceable one.<br>
>>><br>
>>> Therefore, IMO, I am unable to think of any more clear and explicit<br>
>>> way of expressing that than "isKindOf: SequenceableCollection"...<br>
>><br>
>><br>
>> self isCollection and: [self isSequenceable] is better. isKinfOf: is a)<br>
>> not object-oriented as it forces an argument to be in a particular hierarchy<br>
>> rather than having a particular interface, and b) is horribly inefficient,<br>
>> causing a potentially long search of an object's class hierarchy. isKindOf:<br>
>> doesn't just smell, it stinks.<br>
><br>
> Yes, and class-testing via #class as well, for the same reasons. But<br>
> sometimes we really do want to know whether we have a _particular<br>
> implementation_ of a Dictionary, not just dictionary behaviors and<br>
> API's.<br>
<br>
Eliots subStrings: change is obviously a fine improvement and I think<br>
the hasEqualElements: is too with one of Levente's suggestions. But<br>
may we scrutinize this change to Dictionary>>#= just a bit more?<br>
<br>
Everyone agrees using #isDictionary is faster and more OO and less<br>
smelly than isKindOf: Dictionary.<br>
<br>
If #isDictionary refers to particular API and behaviors, one could<br>
argue that a BTree should answer true to #isDictionary, because it has<br>
similar API and behaviors. In the context of _equivalence testing_<br>
though, a BTree is not a Dictionary.<br>
<br>
So as long as we interpret the various #isSomeType methods as truly of<br>
*that type* (same semantics as isKindOf:), and not "similar to", then<br>
I can see no side-effects (unless someone added #isDictionary to<br>
BTree, of course). However, we may want to visit the other #=<br>
implementations elsewhere in the system too, unless this would appear<br>
to be an inconsistency producing its own odor of sorts.<br></blockquote><div><br></div><div>"similar to" is vague. I *don't* interpret isFoo methods as isKindOf: (and think that most experienced Smalltalk programmers don't either). In Smalltalk type = protocol. So these methods imply that an object implements a given set of messages, not that they are of any given class.</div></div>-- <br><div class="gmail_signature">best,<div>Eliot</div></div>
</div></div>