[squeak-dev] Re: swapMouseButtons broken in trunk

David T. Lewis lewis at mail.msen.com
Tue Mar 8 02:12:49 UTC 2016


On Mon, Mar 07, 2016 at 03:13:10PM -0800, marcel.taeumel wrote:
> It's actuallly really simple:
> 
> term := #swapMouseButtonsChanged.
> senders := OrderedCollection new.
> 
> SystemNavigation default allObjectsDo: [:ea |
> 	1 to: ea class instSize do: [:i | |val|
> 		val := ea instVarAt: i.
> 		val isSymbol ifTrue: [
> 			val = term ifTrue: [senders add: ea]]]].
> 
> senders explore.
> 
> On my laptop, it benches to '11.6 per second. 85.9 milliseconds per run.'
> 
> Should we add this to trunk? We could filter out method additions or method
> references to produce cleaner results. The "Senders" shortcut might just
> spawn an additional explorer with the resulting objects. Fairly easy.
> 

It seems to make sense for "senders select: [ :e | e species == Preference ]"
and there is no performance problem. So I guess is OK as long as there is a
good method comment to explain why we do this for the special case of senders
that originate from instances of Preference.

Dave



More information about the Squeak-dev mailing list