From: Ryan Davis Date: 2009-01-19T04:21:42+09:00 Subject: [ruby-core:21412] Re: Proposal: Module#copy_method On Jan 18, 2009, at 08:23 , Eero Saynatkari wrote: > Excerpts from Pit Capitain's message of Sun Jan 18 11:23:48 +0200 > 2009: >> 2009/1/18 Yehuda Katz : >>> I'd like it to be possible to copy methods from one module to >>> another. (...) >> >> Note that on 1.8 you can simply change the line >> >> copy_method me, name >> >> to >> >> define_method(name, me.instance_method(name)) >> >> and it works without #copy_method. > > Only if me <= self, though? One can work around that > by using Method#to_proc, but it has its own problems. I was going to point out the same thing, but it is a 1 line removal to make that not that case and I think it is worth it. Much easier and it opens up a whole lot of possibilities. > I am still not entirely sure of the use case, but I > take Yehuda at his word that he actually uses "foo" > in real code ;) actors or instance-based-inheritance (ala self) are two use cases. I'd love to do the latter more.