Issue #1102 has been updated by Koichi Sasada.

Assignee changed from Yukihiro Matsumoto to Koichi Sasada
Target version set to 2.0.0


----------------------------------------
Feature #1102: Prepend Module
https://bugs.ruby-lang.org/issues/1102

Author: Thomas Sawyer
Status: Feedback
Priority: Normal
Assignee: Koichi Sasada
Category: 
Target version: 2.0.0


=begin
 Currently when a module is included into a classes, it is appended to the class hierarchy (ie. the method lookup order). This of course makes sense, but there are times when it would be useful to *prepend* the module. For example:
 
   class C
     def x; "x"; end
   end
 
   module M
     def x; '[' + super + ']'; end
   end
 
   class C
     prepend M
   end
 
   C.new.x  #=> "[x]"
 
 One big advantage of this is being able to override methods in a safer way, rather than using alias or tricks like alias_method_chain.
=end



-- 
http://bugs.ruby-lang.org/