From: "Haase, Konstantin" Date: 2011-01-09T22:08:37+09:00 Subject: [ruby-core:34269] Re: [Ruby 1.9-Feature#4254][Open] Allow method transplanting Wouldn't that be unnecessary if matz' trait proposal would be implemented? On Jan 9, 2011, at 13:58 , Jonas Pfenniger wrote: > Feature #4254: Allow method transplanting > http://redmine.ruby-lang.org/issues/show/4254 > > Author: Jonas Pfenniger > Status: Open, Priority: Normal > Category: core, Target version: 1.9.3 > > Is there a technical reason to not allow re-binding a method from one module to any other module ? > > module M > def foo; "foo"; end > end > > module N; end > N.send(:define_method, :foo, M.instance_method(:foo)) #=> should not raise > > It's like monkey-patching. Powerful, dangerous, but also really useful. It could allow different variations of method_wrap or alias_method_chain that are not possible right now. > > > ---------------------------------------- > http://redmine.ruby-lang.org > <0001-method-transplanting-Allow-to-set-an-UnboundMethod-t.patch>