gwtmp01 / mac.com wrote:
> On Jan 22, 2007, at 1:55 PM, Christian Neukirchen wrote:
> > While we are at it, can we please have UnboundMethod#to_proc?
> > It would greatly help to implement callbacks from class methods.
>
> This doesn't make sense. Without an object bound to the method
> 'self' will be undefined and so it is nonsensical to try to execute
> the associated code.
Only if the method relies on the 'self'. For example:
class Foo
def self.square( x )
x*x
end
end
could be reasonably translated to a lambda of:
square = lambda{ |x| x*x }
(I personally don't have a use case, but its certainly possible in some
scenarios.)