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

Eliot Miranda eliot.miranda at gmail.com
Wed Dec 9 18:59:33 UTC 2009


On Wed, Dec 9, 2009 at 10:36 AM, Igor Stasenko <siguctua at gmail.com> wrote:

> 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? :)
>

Good suggestion.  <scottish>Now sends are faster this kind of check is much
cheaper</scottish>

>
> >>
> >> Colin
> >>
> >
> >
> >
> >
> >
>
>
>
> --
> Best regards,
> Igor Stasenko AKA sig.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20091209/6fa47e4b/attachment.htm


More information about the Squeak-dev mailing list