[MacRuby-devel] RoxorReturnFromBlockException*
Rob Gleeson
rob at flowof.info
Thu Mar 31 00:05:47 PDT 2011
>
> def trigger_action(sender)
> a_proc = Proc.new { |var|
> puts "hello in proc"
> return 1
> }
> a_proc.call('test')
> puts "hello after proc"
> end
> That code runs without triggering an exception, and prints only "hello in proc" as expected. However, this variation on the code behaves differently:
This shouldn't print "hello after proc". an explicit return should not return control to the caller within a method, it should return for that method.
F. ex, 1 should be the return value of trigger_action.
If it were a lambda, that behavior is expected (printing "hello after proc"), so I guess there's a bug somewhere.
P.S: Gabriel, sorry, I replied to you directly instead of to the list :)
- Rob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-devel/attachments/20110331/2b5fac7b/attachment.html>
More information about the MacRuby-devel
mailing list