<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">&lt;<a href="mailto:asqueaker@gmail.com" target="_blank">asqueaker@gmail.com</a>&gt;</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 &lt;<a href="mailto:ma.chris.m@gmail.com">ma.chris.m@gmail.com</a>&gt; wrote:<br>
&gt;&gt; On Wed, Feb 4, 2015 at 9:07 AM, Chris Muller &lt;<a href="mailto:asqueaker@gmail.com">asqueaker@gmail.com</a>&gt; wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; isSequenceable is a term that refers to a particular *kind* of<br>
&gt;&gt;&gt; Collection, a sequenceable one.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Therefore, IMO, I am unable to think of any more clear and explicit<br>
&gt;&gt;&gt; way of expressing that than &quot;isKindOf: SequenceableCollection&quot;...<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; self isCollection and: [self isSequenceable]  is better.  isKinfOf: is a)<br>
&gt;&gt; not object-oriented as it forces an argument to be in a particular hierarchy<br>
&gt;&gt; rather than having a particular interface, and b) is horribly inefficient,<br>
&gt;&gt; causing a potentially long search of an object&#39;s class hierarchy.  isKindOf:<br>
&gt;&gt; doesn&#39;t just smell, it stinks.<br>
&gt;<br>
&gt; Yes, and class-testing via #class as well, for the same reasons.  But<br>
&gt; sometimes we really do want to know whether we have a _particular<br>
&gt; implementation_ of a Dictionary, not just dictionary behaviors and<br>
&gt; API&#39;s.<br>
<br>
Eliots subStrings: change is obviously a fine improvement and I think<br>
the hasEqualElements: is too with one of Levente&#39;s suggestions.  But<br>
may we scrutinize this change to Dictionary&gt;&gt;#= 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 &quot;similar to&quot;, 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>&quot;similar to&quot; is vague.   I *don&#39;t* interpret isFoo methods as isKindOf: (and think that most experienced Smalltalk programmers don&#39;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>