On Tue, 29 Jan 2002, ts wrote:
> M> I don't know the details about Ruby's internals, you see, and so this
> M> patch is quite bad. Otoh, no-one submitted a better one although it is
> M> very well possible to improve it alot.
>  See [ruby-talk:19761]
>  How do you want correct this ?
>  This is the biggest problem

There has to be some exceptions. First, all unboxed objects are obviously
exempted; that are Fixnum and Symbol objects, and true, false, nil.

Next, the validity of many things in the VM is dependent on the class-of
property of each object. Especially dependent on the expectation of the
object layout (struct). Maybe Classes should not be involvable in
Object#become, or else, at least Classes of incompatible structs should
not (if it's possible to distinguish those at runtime...?)

In general, Object#become will crap on C-based objects, except those
especially designed to do so. (this is the same kind of thing that happens
with special control-flow operations like #callcc and retry)

Object#become is not an essential feature, but the same can be said of
#callcc and retry... somewhere a line has to be drawn. the question is
"where?"...

________________________________________________________________
Mathieu Bouchard                   http://hostname.2y.net/~matju