1.8 can use a proc as a binding:
$ ruby -e "x = 1; p = proc { }; eval 'puts x', p"
1
I believe this was originally gone in 1.9, then added back. But it
appears to be gone again.
$ ruby1.9 -e "x = 1; p = proc { }; eval 'puts x', p"
-e:1:in `eval': wrong argument type Proc (expected Binding) (TypeError)
from -e:1:in `<main>'
Is this correct? I strongly believe Proc should not be usable as a
binding, since I believe it is a breach of trust:
x = 1
foo { puts 'hello' }
puts x # I can never trust the value of x!!
- Charlie