Project

General

Profile

Bug #1322

Updated by jeremyevans0 (Jeremy Evans) 10 months ago

=begin 
  
  a = 1   
   Object.send :define_method, :x do   
     lambda do 
       p a 
       a = 2   
       p a 
     end.call   
   end   
   x(nil) 
   p a 
 
  output is 1,2,1 instead of 1,2,2 
 
  details and possible fix:    http://coderrr.wordpress.com/2009/03/29/ruby-18-define_method-scope-bug/ 
 
 =end 
 

Back