reflection

Niko Schwarz niko.schwarz at gmx.net
Tue Jul 18 13:12:30 UTC 2006


I want to write a Wikipedia article about "Jacketing" and I thought a cool squeak snippet would show both how cool I am and how jacketing works. Unfortunately, the snippet is growing. I wanted to write it neatly short, like this (no callback:)

unblock: selector 
	"Macht den blockierenden Aufruf selector unblockierend."
	|bs| 
	bs := (#blocking , selector) asSymbol. "Der alte Aufruf wird umbenannt"
	
	self 
		addSelector: bs
             withMethod: (self methodAt: selector).
      self addSelector: selector
		withMethod: (self class compile: '[self perform: selector withArgs:args] fork')


but as you probably noticed already, withArgs:args is not quite possible this way. Is there a short line of code that deals with it?

niko
-- 


Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer



More information about the Squeak-dev mailing list