From: Charles Oliver Nutter Date: 2010-09-10T00:37:45+09:00 Subject: [ruby-core:32235] Re: Ruby 2.0 Wiki/Wish-list? On Wed, Sep 8, 2010 at 3:06 PM, Yukihiro Matsumoto wrote: > |Module#prepend (but there is a ticket for that, if I remember correctly): > > I am positive about prepending a module. ��It will be addressed on Ruby > 2.0 in whatever form. I'd like to be part of design and implementation discussions on this, if possible. I've prototyped it previously, but never committed that work anywhere. I believe it will be implemented mostly like the current "include wrapper" for modules, but positioned and dealt with a bit differently. > |And the other one is proper module propagation: > | > | �� �� �� module Extension > | �� �� �� �� �� �� �� def foo > | �� �� �� �� �� �� �� �� �� �� �� 42 > | �� �� �� �� �� �� �� end > | �� �� �� end > | > | �� �� �� Enumerable.send(:include, Extension) > | �� �� �� Array.new.foo # => 42 > | > |The latter being not yet the case is rather confusing and not correctly fixable from within Ruby. > > This one is quite difficult to solve without huge cost. ��If we add > subclass / submodule reference as JRuby does, this one can be solved > but I hesitate to add costly weak references. In JRuby, there are as many weak references as there are subclasses (including module wrappers) and inclusions of modules (modules keep a list of all inclusion points). After booting RubyGems, the total number of such elements is in the 1200-1300 range. Rails and other frameworks would obviously bump this number up a lot. It's not clear what impact it has on the JVM, though it's safe to say that it's not free and that it's probably cheaper than on MRI. - Charlie