On Sunday 27 June 2004 23:03, Gavin Sinclair wrote:
> Sean O'Dell wrote:
> >
> > What happens when x becomes y?  Methods are replaced?
>
> No, the object x points to is discarded and x points to y instead.
> Moreover, *every* pointer to x now becomes a pointer to y, making the
> statement a little more potent than
>
>   x = y
>
> The only description of #become that ever made sense to me was "like
> String#replace or Array#replace, but more general".  The only
> rationalisation for this feature that ever made sense to me was, as usual,
> provided by Jim Weirich, in this thread.  That is, replacing a proxy with
> a "real" object.  I'm pretty sure he was talking about #become, not
> #class=.

In that case, #become sounds like a better way to get pretty much the same 
effect as class=.  I just wonder, though, how on earth you find every 
reference to an object, even in C extensions.  I guess if the GC can walk the 
stack and find Ruby objects, it could be walked for that purpose, too.

	Sean O'Dell