Hello Stef,

i designed own little thingy to intercept any message sent to an
object, including #DNU.

See, if it can be useful for you.
As an example there is a subclass (CVMsgHandlingProxy) which i'm using
to write an inline code to handle messages right in place where i
creating a proxy:

superReceiver
        "lambda, when reducing , sends #perform:withArguments: ,
        and we doing trick by evaluating perform..inSuperClass"
        
        ^ CVMsgHandlingProxy onMessage: [:msg |
                msg selector == #perform:withArguments: ifTrue: [
                        self receiver
                                perform: msg arguments first
                                withArguments: msg arguments second
                                inSuperclass: self receiver class superclass
                ] ifFalse: [
                         self receiver perform: msg selector withArguments: msg 
arguments
                ]
        ]

what is cool in this method:

suppose you have a code like following:

proxy := (someObject asSuperReceiver).

and later you sending a messages to it:

proxy foo.

Now, the trick is, that in the end, a message #foo will be sent to
original 'someObject' , but using its superclass (same semantics, as
you using super foo).
What is cool in CVMsgHandlingProxy, that you don't need to declare a
separate class each time you need to have different proxy behavior..
you just write:

makeProxyFor: object
   ^ CVMsgHandlingProxy onMessage: [:msg | msg sentTo: object ]


2009/2/27 Stéphane Ducasse <[email protected]>:
>
>
>> so what about Morph's abuse of includesSelector: would it be
>> confused by asking ProtoObject instance if it
>> understands #lalaland:
>
> I have to think :)
> Right now it freezes hard :)
>
>
> _______________________________________________
> Pharo-project mailing list
> [email protected]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>



-- 
Best regards,
Igor Stasenko AKA sig.

Attachment: CVMessageCatchingProxy.st
Description: Binary data

Attachment: CVMsgHandlingProxy.st
Description: Binary data

_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Reply via email to