From: Florian Gross Date: 2004-06-29T03:02:57+09:00 Subject: Re: Is it considered Harmful? Gavin Sinclair wrote: > I don't even know what > x = X.new > x.class = Y > is supposed to mean. But I do understand the idea behind this: I can make up a quick example that has no real-world meaning: > irb(main):001:0> array = [1, 2, 3] > => [1, 2, 3] > irb(main):002:0> class MyArray < Array; def reverse; sort_by {rand}; end; end > => nil > irb(main):003:0> array.class = MyArray; array.reverse > => [2, 1, 3] Does it have any use in real world code? I don't know. If anybody has an idea for a better example then please feel free to post it. > x.become y > Are the two ideas really one and the same in this thread? I think that they are different in what they concretely do, though similar in what they abstractly do. (They're both about changing Objects in a way that you usually can't after their construction.) Regards, Florian Gross