RoxorReturnFromBlockException
It looks like MacRuby doesn't allow calling return in a block, which works in 1.8 and 1.9. This looks to be by design, so I'm not sure if the team wants a ticket created. Should I create a ticket? ---------------------------------------- def foo f = Proc.new { return "return from foo from inside Proc.new" } f.call # control leaves foo here return "return from foo" end def bar f = lambda { return "return from bar from inside lambda" } f.call # control does not leave bar here return "return from bar" end def baz f = proc { return "return from baz from inside proc" } f.call # control does not leave bar here in 1.8, but does in 1.9 return "return from baz" end puts foo puts bar puts baz ---------------------------------------- $ ruby blocks.rb return from foo from inside Proc.new return from bar return from baz $ ruby19 blocks.rb return from foo from inside Proc.new return from bar return from baz from inside proc $ macruby blocks.rb uncaught Objective-C/C++ exception... terminate called after throwing an instance of 'RoxorReturnFromBlockException*' Abort trap
Hi Mike, No, this is not by design, you found a bug :-) Please file a ticket. Thanks, Laurent On Oct 29, 2009, at 11:16 PM, Mike Moore wrote:
It looks like MacRuby doesn't allow calling return in a block, which works in 1.8 and 1.9. This looks to be by design, so I'm not sure if the team wants a ticket created. Should I create a ticket?
----------------------------------------
def foo f = Proc.new { return "return from foo from inside Proc.new" } f.call # control leaves foo here return "return from foo" end
def bar f = lambda { return "return from bar from inside lambda" } f.call # control does not leave bar here return "return from bar" end
def baz f = proc { return "return from baz from inside proc" } f.call # control does not leave bar here in 1.8, but does in 1.9 return "return from baz" end
puts foo puts bar puts baz
----------------------------------------
$ ruby blocks.rb return from foo from inside Proc.new return from bar return from baz $ ruby19 blocks.rb return from foo from inside Proc.new return from bar return from baz from inside proc $ macruby blocks.rb uncaught Objective-C/C++ exception... terminate called after throwing an instance of 'RoxorReturnFromBlockException*' Abort trap
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
But it is a named exception... Doesn't that mean it is by design? :) Created #412 On Fri, Oct 30, 2009 at 12:43 AM, Laurent Sansonetti <lsansonetti@apple.com>wrote:
Hi Mike,
No, this is not by design, you found a bug :-) Please file a ticket.
Thanks,
Laurent
On Oct 29, 2009, at 11:16 PM, Mike Moore wrote:
It looks like MacRuby doesn't allow calling return in a block, which works
in 1.8 and 1.9. This looks to be by design, so I'm not sure if the team wants a ticket created. Should I create a ticket?
----------------------------------------
def foo f = Proc.new { return "return from foo from inside Proc.new" } f.call # control leaves foo here return "return from foo" end
def bar f = lambda { return "return from bar from inside lambda" } f.call # control does not leave bar here return "return from bar" end
def baz f = proc { return "return from baz from inside proc" } f.call # control does not leave bar here in 1.8, but does in 1.9 return "return from baz" end
puts foo puts bar puts baz
----------------------------------------
$ ruby blocks.rb return from foo from inside Proc.new return from bar return from baz $ ruby19 blocks.rb return from foo from inside Proc.new return from bar return from baz from inside proc $ macruby blocks.rb uncaught Objective-C/C++ exception... terminate called after throwing an instance of 'RoxorReturnFromBlockException*' Abort trap
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
On Oct 30, 2009, at 02:18, Vincent Isambart wrote:
But it is a named exception... Doesn't that mean it is by design? :) It's an exception used internally, you should not be able to see it from the outside.
Created #412 Thanks!
I put a comment on ticket #364, I think that #412 is a reduction of the same problem I was seeing.
participants (4)
-
Jordan Breeding
-
Laurent Sansonetti
-
Mike Moore
-
Vincent Isambart