From: ts Date: 2002-04-01T21:40:23+09:00 Subject: Re: re-extending object >>>>> "E" == Ed Sinjiashvili writes: E> Yes, I've seen this in rb_include_module. But if you look at *my* E> stupid.rb in the previous message :), you'll see that after extending E> object with B and C, I can't reach neither of A methods. So E> effectively A is not object's ancestor anymore. Here your example a = Object.new # at this step you have # Object a.extend A # ruby extend the object, and add an included class # [A] ==> Object a.extend B # same with B # [B] ==> [A] ==> Object a.extend C # same with C # [C] ==> [B] ==> [A] ==> Object a.extend A # ruby search in the superclass and it found [A] # i.e. the included class which make reference to Module A # it don't try to include it and you still have # [C] ==> [B] ==> [A] ==> Object When you call a.a() it find C#a before A#a a.b() B#b A#b E> Is there any way to #unextend A from the object so I could #extend it E> with A again? I tried to use #remove_const to no avail. Not really sure, but I think that it's possible only in C Guy Decoux