Issue #7702 has been updated by jballanc (Joshua Ballanco).


I should note that this will obviously require much thought and some more research. First big question: how much would break if Proc#binding was removed? How severely, for example, would debugging be effected?

Also, an alternative to complete removal would be to limit the semantics of Proc#binding, such that only identifiers referenced in the body of the proc would be available from the proc's binding. If this alternate solution is considered, there may be overlap with feature request #7747 (Expanded API for Binding Semantics). If the binding returned by Proc#binding was pre-frozen, that may address the concerns listed above, but still allow for (mostly) unhindered debugging.
----------------------------------------
Bug #7702: Remove Proc#binding
https://bugs.ruby-lang.org/issues/7702#change-35678

Author: jballanc (Joshua Ballanco)
Status: Open
Priority: Normal
Assignee: matz (Yukihiro Matsumoto)
Category: core
Target version: next minor
ruby -v: 2.0.0-preview1


=begin
As discussed in the most recent Ruby implementer's meeting and elsewhere over the years, being able to get a handle to the binding of any block/proc has a number of problems:

* Code execution after passing a block/proc in unpredictable, as the binding of said proc can be used to redefine any local, instance variable, method, class, module, etc.
* Potentially sensitive data can leak out of the scope of a method via a proc binding
* Large object graphs may need to be retained for the lifetime of a proc, since any identifier in scope at the time of proc creation must remain live in the event that the binding of the proc is used to evaluate code

Additionally, removal of Proc#binding would enable a number of very useful optimizations and performance improvements.
=end



-- 
http://bugs.ruby-lang.org/