[MacRuby-devel] RoxorReturnFromBlockException*

Gabriel Gilder gabriel at gabrielgilder.com
Thu Mar 31 09:09:51 PDT 2011


Yep, no worries. I probably should have explicitly said that "hello after
proc" doesn't print, which is the correct behavior.

-Gabriel

On Thu, Mar 31, 2011 at 12:07 AM, Rob Gleeson <rob at flowof.info> wrote:

>
> On 31 Mar 2011, at 08:05, Rob Gleeson wrote:
>
>
>
>
>  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
>
>
> Oops, sorry Garbiel. I misread your post. "hello IN proc" is indeed printed
> and expected. :)
>
> - Rob
>
>
>
>
>
>
> _______________________________________________
> 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/20110331/42d78bd4/attachment.html>


More information about the MacRuby-devel mailing list