On Jan 10, 2011, at 14:30 , Yukihiro Matsumoto wrote:

> Hi,
> 
> In message "Re: [ruby-core:34291] Re: [Ruby 1.9-Feature#4254][Open] Allow method transplanting"
>    on Mon, 10 Jan 2011 16:15:40 +0900, Ryan Davis <ryand-ruby / zenspider.com> writes:
> 
> |You've argued that being able to define != contradictory with == (a serious problem in my mind) is ok because we trust rubyists to do the right thing. How is this any different? If the method transplanted is pure ruby, why not allow it?
> 
> Although I trust the programmers, we have another rule for the
> interpreter, that Ruby should not cause segmentation fault from any
> Ruby program.

How can transplanting a pure-ruby method cause a segfault?

I see nothing in the original example that could cause that:

>  module M
>    def foo; "foo"; end
>  end
> 
>  module N; end
>  N.send(:define_method, :foo, M.instance_method(:foo)) #=> should not raise

When we were trying it we were using bind on instances, not define_method on classes/modules. That seems even safer.