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

Eliot Miranda eliot.miranda at gmail.com
Wed Dec 9 18:12:13 UTC 2009


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.


> Colin
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20091209/7d1b4975/attachment.htm


More information about the Squeak-dev mailing list