Created
January 15, 2013 23:08
-
-
Save jballanc/4543026 to your computer and use it in GitHub Desktop.
Implications of MRI's current implementation of bindings...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def munger(&block) | |
block.binding.eval('b = rand(99)') | |
end | |
def doit | |
a = 1 | |
b = 2 | |
munger do; end | |
puts "a + b = #{a + b}" | |
end | |
doit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Should you be able to extract an environment from any closure?
Should all bindings in the lexical scope of the closure be captured by the environment?
Should bindings be live in the environment?
What happens if you define a new binding using the environment?