From: Marcello Barnaba Date: 2007-02-21T05:11:22+09:00 Subject: Re: adding local variables via block Hi, On Tuesday 20 February 2007 21:02, Patrick Hurley wrote: > I am not recommending this, but you can force a binding into an eval. > However, due to how the Ruby parser identifies local variables, they > need to be referenced in "code" before you can use them normally. my irb disagrees: vjt@neutrino:~$ irb /home/vjt| irb(main):001:0> eval 'x = 42', binding 42 /home/vjt| irb(main):002:0> x 42 /home/vjt| irb(main):003:0> RUBY_VERSION "1.8.5" /home/vjt| irb(main):004:0> -- pub 1024D/8D2787EF 723C 7CA3 3C19 2ACE 6E20 9CC1 9956 EB3C 8D27 87EF