From: Wayne Blair Date: 2001-06-01T14:18:58+09:00 Subject: [ruby-talk:16114] Re: Strange idea... exporting from a scope >From: "Hal E. Fulton" > What if Ruby had a method explicitly > for "passing" a definition to the outer > scope? (I have no idea how this might > be implemented.) > > my_method do |x,y,z| > # ... > my_var = 123 # my_var is created here > #... > export :my_var > end > > # Now this scope knows about my_var! > puts my_var # 123 Hi Hal, Maybe I'm missing something (like I have no idea what the block problem is), but why wouldn't you just declare the variable in the outer scope then set it from inside the block: my_var = nil my_method do |x,y,z| # ... my_var = 123 #... end puts my_var # 123 Wayne