How to use a variable reference another variable?


#1

since variable names are not objects, is there any possible ways to do
this? thank you!


#2

Given that Ruby doesn’t allow this, maybe the problem you want to solve
has a simple solution using another language feature. For what
purpose(s) would you want to use variable references?

Lionel

Just curious. i vaguely have heard of it before


#3

Haofei W. wrote the following on 30.12.2006 20:50 :

since variable names are not objects, is there any possible ways to do
this? thank you!

Given that Ruby doesn’t allow this, maybe the problem you want to solve
has a simple solution using another language feature. For what
purpose(s) would you want to use variable references?

Lionel


#4

On 12/30/06, Haofei W. removed_email_address@domain.invalid wrote:

Given that Ruby doesn’t allow this, maybe the problem you want to solve
has a simple solution using another language feature. For what
purpose(s) would you want to use variable references?

Just curious. i vaguely have heard of it before

If you’re interested, I had a thread called “patching strings together
to make a variable” a long while back which had some references to
doing such tricks…