From: Cody Brocious Date: 2009-09-14T19:13:08+09:00 Subject: [ruby-core:25573] Re: Implicit block argument in Procs Thanks for the quick response. If the block to 'set' is executed in the top level context, though, why is it that an explicit block argument works? It seems that unless you're passing blocks into Procs that assume no implicit block argument exists, this wouldn't change the usual behavior. On Mon, Sep 14, 2009 at 6:07 AM, Nobuyoshi Nakada wrote: > Hi, > > At Mon, 14 Sep 2009 18:57:14 +0900, > Cody Brocious wrote in [ruby-core:25571]: >> Is this behavior intentional? �If not, is there a limitation in >> rb_vm_invoke_proc() which makes passing an implicit block a problem? >> It seems that killing the arg_block check would solve the issue if >> there's no problem in rb_vm_invoke_proc(). > > Absolutely intentional. �`yield' calls the block given to the > context. �In your example, the yield in the block to `set' is > executed in the top level context, which has no block. > > -- > Nobu Nakada > >