From: Robert Klemme Date: 2012-02-22T22:36:22+09:00 Subject: Re: Accessing a local variable through a symbol On Mon, Feb 20, 2012 at 9:27 PM, Ralph Shnelvar wrote: > Let's say I have > >   def y >     a=42 >     x = some_kernel_function(:a)  # I'd like x to be 42 >   end > > Is there a way to get x to be 42? It generally does not make sense: If you know all your local variables you do not need a dynamic approach. If you need dynamic variables you better stuff things in a Hash because you cannot create local variables dynamically which could be seen. I am aware of only one use case where it may actually make sense. What are you trying to achieve? Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/