Novel form of refactoring

Avi Bryant avi at beta4.com
Fri Oct 24 22:35:01 UTC 2003


Brian T Rice wrote:

>On Fri, 24 Oct 2003, Marcus Denker wrote:
>  
>
>>Yes, but it doesn't do any error checks: "class methodDict" could
>>be empty. For a demo it should be enough to do
>>
>>[
>>class := Smalltalk allClasses atRandom.
>>Browser fullOnClass: class selector: (class methodDict keys atRandom]
>>] on: Error do: [:e | e retry]
>>
>>but "on: Error do: [:e | e retry]" isn't a good idea for production code,
>>really not ;-))
>>
>>   Marcus
>>    
>>
>
>I also think the code side comparison is really unfair, considering that
>the emacs code contains a simple interface for the user, and specifically
>for defining a scope within which to search: after all, I don't want to
>jump to Balloon code when I have no idea what's crufty and what's not.
>
How about this:

packageName := 'MyPackage'.
methodRef := (PackageInfo named: packageName) methods atRandom.
Browser fullOnClass: methodRef actualClass selector: methodRef methodSymbol.

Cheers,
Avi




More information about the Squeak-dev mailing list