Actions
Bug #5288
closedMethod#to_proc Procs have "sticky" bindings
Description
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!
Files
Updated by nobu (Nobuyoshi Nakada) over 13 years ago
- Status changed from Open to Rejected
A method is bound to the internal structure of its receiver.
Therefore this is a spec.
Actions
Like0
Like0