[squeak-dev] SystemNavigation >> #allMethodsSelect:localTo:

Frank Shearar frank.shearar at gmail.com
Tue May 21 21:40:26 UTC 2013


allMethodsSelect: aBlock localTo: aClass
    "Answer a SortedCollection of each methodr in, above, or below the given
    class that, when used as the argument to aBlock, gives a true result."

    | aSet |
    aSet := Set new.
    Cursor wait showWhile:
        [aClass theNonMetaClass withAllSuperAndSubclassesDoGently:
            [:class |
                class selectorsAndMethodsDo:
                    [:aSelector :aMethod|
                        (aBlock value: aMethod) ifTrue:
                            [aSet add: (MethodReference new
setStandardClass: class methodSymbol: aSelector)]]].
        aClass theNonMetaClass class withAllSuperAndSubclassesDoGently:
            [:class |
                class selectorsAndMethodsDo:
                    [:aSelector :aMethod|
                        (aBlock value: aMethod) ifTrue:
                            [aSet add: (MethodReference new
setStandardClass: class methodSymbol: aSelector)]]]].
    ^aSet

Um. That is just an accidental duplication of the aClass
theNonMetaClass class withAllSuperAndSubclassesDoGently: block, right?

frank


More information about the Squeak-dev mailing list