From: Mauricio Fernandez Date: 2006-11-13T00:27:02+09:00 Subject: Re: Create local variable in Binding after it's creation On Sun, Nov 12, 2006 at 11:27:07PM +0900, Christian Surlykke wrote: > S�ndag 12 november 2006 15:18 skrev Mauricio Fernandez: > > > If you try to use 'a' before the parser sees 'a = ...', it will be considered > > a method call, and you'll get a NameError even if you give it a value > > afterwards/in eval. > > Ah, I see. Thanks. > > > > > BTW. this is changing in 1.9. > > In what way? My example seems to work the same way with ruby-1.9... Both eval("a = 7") eval("a") and eval("a = 7", binding) eval("a") will raise a NameError in the future, so you'll have to do binding = binding # heh eval("a = 7", binding) eval("a", binding) [ruby-core:09388] This can be seen as a step towards less inclusive closures and lambda lifting. -- Mauricio Fernandez - http://eigenclass.org - singular Ruby