[squeak-dev] Utilities' symbol mangling methods

Frank Shearar frank.shearar at gmail.com
Fri Nov 29 20:43:56 UTC 2013


Utilities has #inherentSelectorForGetter:, #setterSelectorFor: and
#getterSelectorFor: Etoys makes extensive use of these.
MorphicExtras-Flaps also uses Utilities class >> #simpleSetterFor:

I want to remove these from Utilities. The first way to do this that I
thought of was to push these messages to String or Symbol, so you
could say 'foo' asSetterSelector. That looks quite neat in the code
affected by the change. (You also lose a pair of ()s in a lot of
places.)

But it occurred to me after I did all this that I could also avoid the
monkey patching by adding, say, a class EtoysSymbolExtensions, to
house the methods. You'd change the "Utilities getterSelectorFor:
thing" to "EtoysSymbolExtensions getterSelectorFor: thing".

Thoughts? Which would be better/nicer? The former makes for better
looking code, while the latter avoids monkey patching.

frank


More information about the Squeak-dev mailing list