From: Jeremy Henty Date: 2006-11-02T20:30:15+09:00 Subject: Re: variable pointer On 2006-11-01, dblack@wobblini.net wrote: > Here's an example from a program which models Ideas; each Idea belongs > to a Page. > >>> i = Idea.find(6) >=> #"6", "id"=>"6", > "content"=>"Go to Paris"}> > > # Save the idea's page in p >>> p = i.page >=> #"6", > "title"=>"Domestic travel", "id"=>"6"}> > > # Change the idea's page to a different one >>> i.page = Page.find(7) >=> #"1", > "title"=>"Foreign travel", "id"=>"7"}> > > # Examine the saved page -- it's the new one >>> p >=> #"1", > "title"=>"Foreign travel", "id"=>"7"}> Yikes! How is this even possible? Somehow the method is changing the variable bindings in its caller. Is this related to Binding.of_caller (which exploited a bug in 1.8.4 and broke when the bug was fixed in 1.8.5 - see )? Jeremy Henty