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

Colin Putney cputney at wiresong.ca
Wed Dec 9 17:15:58 UTC 2009


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.

Colin



More information about the Squeak-dev mailing list