>>>>> "H" == Hugh Sasse Staff Elec Eng <hgs / dmu.ac.uk> writes:

H> Yes, that is what I tried -- it makes no difference, really, because it
H> still ends up as a superclass...

 Try this

pigeon% cat b.rb
#!/usr/bin/ruby
module B
   def self.append_features(kl)
      klass = self
      kl.class_eval do
         if method_defined?(:aa) && !method_defined?("_aa_#{klass}_")
            alias_method "_aa_#{klass}_", :aa
            remove_method :aa
         end
      end
      super
   end
   def aa
      puts "B::aa"
      _aa_B_ if respond_to? :_aa_B_
   end
end

def aa
   puts "object"
end

class A
   def aa
      puts "A::aa"
#      super
   end

   include B
end

A.new.aa
pigeon% 

H> I don't think it will, but I'll bear that in mind.

 To see the problem with #super, remove the comment in A#aa


Guy Decoux