Feature #9777

Updated by nobu (Nobuyoshi Nakada) almost 9 years ago

Currently different block objects such as a lambda can be converted into to a proc: 

 However you cannot turn a Proc instance into a lambda. Since a Proc and lambda behave differently sometimes you may want to convert between the two functionalities. One example is a `return` return inside of the block. In a lambda the `return` return keyword exits the closure, in a Proc the `return` return keyword raises an exception. 

 There is currently no implementation standard way to convert a Proc to a lambda. I made a gem that makes this easier: but it seems overkill. 

 If MRI introduces a `to_lambda` to_lambda method on Proc then we can standardize on an interface for this behavior. This question on stack overflow has been upvoted many times: I think other Ruby developers would like this behavior supported by Ruby core.