2008/11/25 Klaus D. Witzel klaus.witzel@cobss.com:
On Mon, 24 Nov 2008 23:21:37 +0100, Igor Stasenko wrote:
Here the abstract implementation of proxy which could catch any messages
Nice catch knowing that VM continues lookup at the superclass if it found nil instead of a MethodDictionary ;)
:)
except those, which handled by VM directly, like #class.
http://lists.squeakfoundation.org/pipermail/squeak-dev/2008-November/132520....
Yeah, with this trick, and some more efforts, its now possible to implement a truely transparent proxes in squeak.
You can implement own proxy by subclassing MessageCatchingProxy and providing own implementation of #handleMessage:forProxy:
I'm not sure, if it should be in 'Kernel-Methods'. I just thinking that it could be quite useful to people who need proxies or different message catching techniques, because it provides a really clean message catching comparing to any proxy which is subclass of ProtoObject or Object, because such kind of proxies can't cleanly intercept messages implemented in those classes without completely overriding them:
ProtoObject methodDict size 35 Object methodDict size 454