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

> Hi,
>=20
> 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:
>=20
> |You've argued that being able to define !=3D contradictory with =3D=3D =
(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?
>=20
> 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
>=20
>  module N; end
>  N.send(:define_method, :foo, M.instance_method(:foo)) #=3D> should =
not raise

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