On Fri, Dec 21, 2001 at 01:10:08AM +0900, Chr. Rippel wrote:
> Hi,
> 
> > what is instance_method, I can't find the doc for it in programming ruby?
> > Benoit
> 
> instance_method is defined in 1.7.2. The return value is an UnboundMethod.
> Anyway I am sort of wandering why UnboundMethod subclasses Method -
> it seems to me that it should be the other way around - see the quick patch
> below - (I did not bother to remove the superflous method definition of
> umethod_call etc.)

Well, a Method is really a BoundMethod, and a BoundMethod is not an
UnboundMethod.  In my mind, it doesn't really make sense to have Method
inherit from UnboundMethod.

An UnboundMethod, on the otherhand, is a Method, but one which has a
different action defined for the call() method and the unbind() method,
and which also has an additional bind() method.  Perhaps, though, it
might make sense to have BoundMethod and UnboundMethod inherit from
Method (and make Method an abstract class).  This might not be as clean
to write code for, though.

Paul