[squeak-dev] Re: How about... something completely different?

Igor Stasenko siguctua at gmail.com
Wed Dec 9 18:36:41 UTC 2009


2009/12/9 Eliot Miranda <eliot.miranda at gmail.com>:
>
>
> On Wed, Dec 9, 2009 at 9:15 AM, Colin Putney <cputney at wiresong.ca> wrote:
>>
>> On 8-Dec-09, at 11:02 PM, Igor Stasenko wrote:
>>
>>> In this respect, interesting, how to avoid a pitfal of circular
>>> delegation.
>>>
>>> x -> y -> x
>>>
>>> if i send a message to x, and got DNU, it is automatically delegated to
>>> y,
>>> but in same way as x could delegate to y, y could delegate to another
>>> object , and finally some of them
>>> in delegation chain could delegate back to x. Circle is closed, and VM
>>> will loop forever trying to lookup a method not implemented in any of
>>> objects in such delegation chain.
>>
>> Yup, that's certainly a possibility. The only remedy is "don't do that."
>> Consider it a bug, in the same way that we currently consider infinite
>> recursion a bug.
>
> and if the concern is a loop in the VM's lookup then all it has to do is
> remember the object or class it started the lookup in and abort (go straight
> to sending DNU) if it meets the same one again.

Care to add it to Cog as a precaution against future hacks? :)

>>
>> Colin
>>
>
>
>
>
>



-- 
Best regards,
Igor Stasenko AKA sig.



More information about the Squeak-dev mailing list