2011/10/1 SASADA Koichi <ko1 / atdot.net>: > I made a questionnaire "What do you want to introduce in 2.0?" in my > RubyConf2011 presentation. > > Followings are results from my memo. ¨Âíåíï óèïõìä âå éîãïíðìåôåóï > please complement them. Thank you for the list. I'd like to introduce: 1. Module#prepend. Include a module ahead of the ancestor chain. 2. Refinements. @shugo's proposal. 3. MVM, with inter-vm message passing. 4. Fast, native debugger. We have ruby-debug19, but it relies on internal headers and API so it's hard to build and often broken. 5. Easy module dependencies and a hook for "included in a class." Nesting modules to build up behavior could be friendlier and more concise. # Low-level included hook makes this possible, but not so pretty. module A def self.included(klass) klass.class_eval { print 'A' } end end # Concise form: module A class_included { print 'A' } end # Handling dependent modules is a headache if you want to # call a hook on each dependent module when this is included # in a class. It's worse if you nest dependent modules further. # You have to handle the dependencies yourself in self.included # or expect the class to include them also (by documenting the # requirement, for example). module B def self.included(klass) klass.class_eval { include A } print 'B' end end module C def self.included(klass) klass.class_eval { include B } print 'C' end end class Example include C end # prints ABC # Much simpler module B include A class_included { print 'B' } end module C include B class_included { print 'C' } end class Example include C end # prints ABC See http://en.ihower.tw/post/454873995/rails3-activesupport-concern for more on module dependencies and how ActiveSupport::Concern wraps up these conventions. Jeremy