From: Chris Pine Date: 2002-12-16T00:43:47+09:00 Subject: Re: un-extending objects This reminds of me of something I was thinking of recently, which would make something like this pretty easy: What if we could change an object's class (or a class's parent class) at runtime? I started thinking about things we weren't allowed to do in Ruby after reading about the development of Arc: http://www.paulgraham.com/arcll1.html "By default, allow." The idea of allowing just about everything, of assuming the programmer is brilliant, is a neat idea. In any case, you could create a subclass of the object's class with whatever functionality or mixins you wanted, then switch the object's class to the new class, run the block, and switch it back. Assuming this were part of Ruby, it would allow us to do this without having to grab the singleton class (which I *think* is what matz didn't like, for some reason). Actually, if the object didn't already have a singleton class, you wouldn't have to create one... though you do have to create the new subclass, so I don't see what that buys you, except that you *can* delete a class. Chris