<br><br><div class="gmail_quote">On Tue, May 21, 2013 at 2:40 PM, Frank Shearar <span dir="ltr"><<a href="mailto:frank.shearar@gmail.com" target="_blank">frank.shearar@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
allMethodsSelect: aBlock localTo: aClass<br>
"Answer a SortedCollection of each methodr in, above, or below the given<br>
class that, when used as the argument to aBlock, gives a true result."<br>
<br>
| aSet |<br>
aSet := Set new.<br>
Cursor wait showWhile:<br>
[aClass theNonMetaClass withAllSuperAndSubclassesDoGently:<br>
[:class |<br>
class selectorsAndMethodsDo:<br>
[:aSelector :aMethod|<br>
(aBlock value: aMethod) ifTrue:<br>
[aSet add: (MethodReference new<br>
setStandardClass: class methodSymbol: aSelector)]]].<br>
aClass theNonMetaClass class withAllSuperAndSubclassesDoGently:<br>
[:class |<br>
class selectorsAndMethodsDo:<br>
[:aSelector :aMethod|<br>
(aBlock value: aMethod) ifTrue:<br>
[aSet add: (MethodReference new<br>
setStandardClass: class methodSymbol: aSelector)]]]].<br>
^aSet<br>
<br>
Um. That is just an accidental duplication of the aClass<br>
theNonMetaClass class withAllSuperAndSubclassesDoGently: block, right?<br></blockquote><div><br></div><div>No, it's not :) It's preserving existing behavior, which is to search class and instance side. Note that</div>
<div><br></div><div> aClass theNonMetaClass withAllSuperAndSubclassesDoGently:</div><div> [:class|</div><div> {class. class class} do: aBlock</div><div><br></div><div>is not equivalent to </div><div><br></div><div> aClass theNonMetaClass withAllSuperAndSubclassesDoGently: aBlock</div>
<div> aClass theNonMetaClass class withAllSuperAndSubclassesDoGently: aBlock</div><div><br></div><div>because the latter searches Behavior, ClassDescription, Class etc, while the former doesn't.</div><div><br></div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class="HOEnZb"><font color="#888888"><br>
frank<br>
<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>best,<div>Eliot</div>