rubinius/rubinius — pull request #2160 by ryoqun (2013-02-14 13:15:10+00:00)
Title: Merge Proc::Method into Proc

PHEEEW

I finally managed to merge `Proc::Method` into `Proc`. Users won't see the unfamililar implementaion-detail class name anymore.

I made `Proc` store the bound `Method` object to `@ruby_method`, instead of reusing the existing `@bound_method` to avoid confusion.

`Proc` objects can be bound to `Method`, `NativeMethod`, or `NativeFunction`. As you can see from this pull request, those don't share the same base class nor have compatible interface.

So, I think storing those all kinds of objects to the single `@bound_method` is a bit overkill.

Also, should we consider to rename `@bound_method` to `@native_method`? Any suggestions are greatly welcomed. :)

These efforts are done only to ditch this ugly logic:

block = __from_block__(env)

- if block.class != self and block.class != Method
+ if block.class != self
block = block.dup
Rubinius::Unsafe.set_class(block, self)
end

May Rubinius be the cleanest implementation of Ruby.