From: Sean O'Dell Date: 2004-06-26T02:09:00+09:00 Subject: Re: Is it considered Harmful? On Friday 25 June 2004 09:55, ts wrote: > >>>>> "D" == Dave Thomas writes: > > D> Modules (such as Enumerable) only add methods. > > This is worst than this : Enumerable rely on the method #each which is > implemented differently by each class, this is why it work I have to admit when I'm wrong. At least doing it brute-force, changing an object's class DOES crash Ruby. But I've only done a rudimentary test where I simply replaced the klass VALUE (in C) with something else. I can't understand why Ruby would crash, except that internally there must be a whole lot of code that doesn't do any kind of checking of internal values. I think I can see why Guy says this can't be done. I haven't seen much of the internal Ruby implementations, but my initial guess is that Ruby makes an assumption about the presence, and state, of internal data kept with each object/class. If that's the case, it would probably be a mountain of work to back through it all and place checks on that internal data. Sean O'Dell