From: "David A. Black" Date: 2005-05-06T22:34:58+09:00 Subject: Re: object reference handle (like perl's reference to scalar) Hi -- On Fri, 6 May 2005, Eric Mahurin wrote: > This looks nice too. I haven't looked at DelegateClass yet, > but it looks kind of like what's in evil.rb/become > (__set_obj__). I would like to add this to my Object.ref which > already does a variety of things. > > What you have is definitely different than my earlier thing: > > ref {:x} # refers to the variable x > x.ref # refers to object in the variable x > > example: > > x = "hello" > y = "world" > z = x > swap(ref{:x},ref{:y}) # swaps what x and y point to > x -> "world" > y -> "hello" > z -> "hello" This is uncomfortably (for me) close to all the symbolic reference stuff one sees in Perl. It seems similarly verbose and fragile. I don't think it's even looked upon very favorably in Perl circles. In any case I much prefer: x,y = y,x David -- David A. Black dblack@wobblini.net