From: Austin Ziegler Date: 2006-11-01T23:53:21+09:00 Subject: Re: variable pointer On 11/1/06, akbarhome wrote: > @c = "donal" > @b = @c > > abrakadabra(@b, @c) > > @c = "mickey" > > print @b resulted "mickey" > > Is there something like abrakadabra method in ruby? The only thing I > can think to emulate this is using global variable. No. Variables aren't pointers or locations; they're labels for objects. By changing @c you have changed its object. You haven't changed @c. However, you can trick it out with a Var (or Ref) object (google around for various implementations) where you can set the value, something like: c = Ref.new("donald") b = c c._value = "mickey" puts b -austin -- Austin Ziegler * halostatue@gmail.com * http://www.halostatue.ca/ * austin@halostatue.ca * http://www.halostatue.ca/feed/ * austin@zieglers.ca