ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
From: Nobuyoshi Nakada <nobu@ruby-lang.org>
To: ruby-core@ruby-lang.org
Subject: [ruby-core:25572] Re: Implicit block argument in Procs
Date: Mon, 14 Sep 2009 19:07:27 +0900	[thread overview]
Message-ID: <4aae15dd.1608c00a.592f.099c@mx.google.com> (raw)
In-Reply-To: <4987c3660909140257g58c1f6e3keba9e312020a4a89@mail.gmail.com>

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

  reply	other threads:[~2009-09-14 10:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-14  9:57 [ruby-core:25571] Implicit block argument in Procs Cody Brocious
2009-09-14 10:07 ` Nobuyoshi Nakada [this message]
2009-09-14 10:13   ` [ruby-core:25573] " Cody Brocious
2009-09-15 12:28     ` [ruby-core:25601] " Nobuyoshi Nakada

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.ruby-lang.org/en/community/mailing-lists/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4aae15dd.1608c00a.592f.099c@mx.google.com \
    --to=ruby-core@ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).