[squeak-dev] Re: Detecting DNU sent by VM, not by code

Igor Stasenko siguctua at gmail.com
Mon Nov 24 01:35:07 UTC 2008


i think i found the way..

AlmostTransparentProxy class>>new

   | anonClass |
   anonClass := self clone.
   anonClass superClass: self ; methodDict: nil.
   ^ anonClass basicNew

Then if i do:

proxy := AlmostTransparentProxy new.

on any message i sending to proxy, i'll get #cannotInterpret: message.
And event if you send #cannotInterpret: from language,
it will receive #cannotInterpret: with message selector == #cannotInterpret:  :)


2008/11/24 Igor Stasenko <siguctua at gmail.com>:
> Hello list,
> is there any way to detect that DNU message was sent by VM , as result
> of failed method lookup, not intentionally by language side?
>
> I need to have a pseudo-class which intercepts _any_ message you
> sending to its instance, including #doesNotUnderstood: sent directly
> by language side.
> Of course, i can't do anything with messages which handled directly by
> VM , such as #class , but at least i want to make sure that rest of
> messages is intercepted with guarantee.
>
>
> --
> Best regards,
> Igor Stasenko AKA sig.
>


-- 
Best regards,
Igor Stasenko AKA sig.



More information about the Squeak-dev mailing list