[MacRuby-devel] RoxorReturnFromBlockException

Mike Moore blowmage at gmail.com
Thu Oct 29 23:57:47 PDT 2009


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 at 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 at lists.macosforge.org
>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>>
>
> _______________________________________________
> MacRuby-devel mailing list
> MacRuby-devel at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-devel/attachments/20091030/33b858d0/attachment.html>


More information about the MacRuby-devel mailing list