Issue #1102 has been updated by Yusuke Endoh.


This feature is listed as matz's "must-have."  [ruby-core:39837]
Are there any volunteers to be a facilitator, to create a prototype,
and/or, to study the semantics and implementation?
Sorry I'll have no time, and completely forgot the discussion.

       ___
      _|*|_
      (`_`)
      m9
    
    I WANT YOU

-- 
Yusuke Endoh <mame / tsg.ne.jp>
----------------------------------------
Feature #1102: Prepend Module
https://bugs.ruby-lang.org/issues/1102

Author: Thomas Sawyer
Status: Feedback
Priority: Normal
Assignee: Yukihiro Matsumoto
Category: 
Target version: 


=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/