On 17.08.2007 17:35, Larry Kluger wrote:
> Hi,
> 
> How can a method gain access to the enclosing method's locals?
> 
> def go2(arg)
>   def hi
>     puts "Hi #{arg}!"
>   end
> 
>   a={:h => :hi}
>   send(a[:h])
> end
> 
> go2 'Larry' ==>> NameError: undefined local variable or method `arg' for
> main:Object
> 
> In go2, is there a clean way for the hi method to have access to the
> arg local?

What exactly do you need that for?  I am curious because I haven't 
stumbled across a problem where I needed this for.

Kind regards

	robert