Michael Keller wrote:
> I have strong interest in highly dynamic languages, particularly
> prototype-based languages - and am still looking for the language that I
> have to "abuse least" to achieve what I want (for my attempt in Java,
> see http://diamondmud.sourceforge.net/, particularly
> http://diamondmud.sourceforge.net/architecture.html)
>
> Ruby, apart from just being a great language, has two features that are
> fantastic for me:
> - open classes: I can add and remove methods "at runtime"
> - mixins; this is highly reminiscent of prototype based languages anyway.
>
> Now I have two questions:
>
> 1. Can I change the superclass for an already defined class? That is,
> remove an existing relationship or add a new one? I haven't been able to
> figure that out.

Not going to happen. But you can use modules and delegation to get a
similar effect. Subclassing is over rated anyway.

> 2. Can I also remove modules that I included into a class? I have only
> found a very ugly way to do this: undefine the class (Klass = nil) and
> define it anew. I am not sure even, what the effect was on existing
> instances; if they adapted the new behaviour or not.

Here again, not happening, but this one might not be so far out of
reach "one day". For now at least you have use other techniques.

In both cases, there's probably a good alternative to accomplish what
you trying to do.

T.