From: Nobuyoshi Nakada Date: 2011-09-07T11:01:47+09:00 Subject: [ruby-core:39317] [Ruby 1.9 - Bug #5288][Rejected] Method#to_proc Procs have "sticky" bindings Issue #5288 has been updated by Nobuyoshi Nakada. Status changed from Open to Rejected A method is bound to the internal structure of its receiver. Therefore this is a spec. ---------------------------------------- Bug #5288: Method#to_proc Procs have "sticky" bindings http://redmine.ruby-lang.org/issues/5288 Author: Ernie Miller Status: Rejected Priority: Normal Assignee: Category: Target version: 1.9.2 ruby -v: ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin11.1.0] Please see the attached sample script (or view the gist at https://gist.github.com/1197634). It would appear that a Proc object that is obtained via Method#to_proc behaves unlike other Procs when used with instance_exec. I'm not entirely sure that this is a bug so much as a gap in documentation, but I found it interesting, in either case, to note the subtle difference. The summary: A Proc object created by Method#to_proc doesn't actually allow instance_exec to modify "self" for the block. Sample output is provided in the comments of the attached script. Thanks in advance! -- http://redmine.ruby-lang.org