[MacRuby-devel] RoxorReturnFromBlockException*

Rob Gleeson rob at flowof.info
Wed Mar 30 11:05:28 PDT 2011


On 30 Mar 2011, at 18:23, Gabriel Gilder wrote:

> I think you want "break" instead of "return". You can't return from a block (Proc).
> 
> -Gabriel

That's not strictly true, you can if the Proc.new { } object was initialized within a method (like it is here).
However calling return explicitly will not return control to the caller.  

Perhaps you could try a lambda, which behaves like a method when you use return explicitly (returns control to the caller), or 
use break as Gabriel suggested. 

- Rob


More information about the MacRuby-devel mailing list