Vasyl Smirnov wrote:
> Hi,
> 
> I wonder if there is any way to create local variables dynamically,
> for example, given
> 
> def foo
>   bar
>   puts x, y
> end
> 
> is it possible for bar to somehow create and initialize x and y?
> Binding doesn't seem to be modifiable..
> 
> Or am I asking too much? :)
> 

Hmmm...local variables are called local because they're local to the 
method that uses them. A variable that's shared between two methods 
isn't local.

If foo and bar are both methods in the same class, use instance 
variables. If they're not both in the same class, use global variables.

-- 
RMagick: http://rmagick.rubyforge.org/