Hi Denis,

> On Feb 15, 2016, at 6:53 AM, Denis Kudriashov <dionisi...@gmail.com> wrote:
> 
> 
> 2016-02-15 15:32 GMT+01:00 Mariano Martinez Peck <marianop...@gmail.com>:
>> As far as I can remember (this was about 4 years ago) The use of 
>> #cannotInterpret: was the only way to be able to intercept everything 
>> without breaking the system. Subclassing from ProtoObject make your proxy to 
>> understand some messages. Subclassing from nil was technically possible, but 
>> I found out the system would simply crash as it didn't know at all how to 
>> handle other subclasses of nil. Even with the debugging support I added as 
>> you can read in the paper. Maybe things have changed.
>> 
>> If subclassing from nil does not break the system and you can still inspect, 
>> debug proxies, then sure, you can give a try to Ghost using #dnu rather than 
>> #cannotInterpret:. In fact, I would like to have a dnu-based approeach that 
>> is as reliable as it was #cannotInterpret: in the sense of how much I can 
>> intercept. With #cannotInterpret I could trap EVERYTHING (everything but 
>> #==) and then decide what to do. Subclassing from nil would get you there 
>> too if you make it work. 
> 
> Actually I already implemented it many yeas ago for Mocketry. But subclassing 
> from nil works correctly only in VW. I got problems when porting it to Squeak 
> (at that time). 
> Now I want to give DNU another chance. It will simplify logic very much. It 
> will remove strange hierarchy of proxies which is needed for trick but raises 
> many questions.

There is no reason in principle why Squeak/Pharo should not be able to use MNU 
proxies in the same way as VW.  The key is to use the mirror primitives in 
basic inspectors that are used to inspect the proxies and in the debugger to 
simulate code.  Without the mirror primitives many sends to a proxy are likely 
to create an infinite recursion.  As yet we don't have a robust low space 
handler that catches infinite recursion so debugging can be frustrating.  But 
we can work on this.  IMO the MNU approach is to be preferred.

Reply via email to