From: "David A. Black" Date: 2008-04-29T20:18:28+09:00 Subject: Re: References in Ruby Hi -- On Tue, 29 Apr 2008, Marcin Tyman wrote: > Hi guys, > > I was quite a bit confused when write following code: > > a = 10 > b = a > a = 50 > > puts b # -> puts 10 > > Why?? Since everything is a reference in Ruby I expected "puts 50". When you assign to a variable, you are reusing the identifer (a, in this case). Any previous binding between the identifier and a value is discarded. David -- Rails training from David A. Black and Ruby Power and Light: INTRO TO RAILS June 9-12 Berlin ADVANCING WITH RAILS June 16-19 Berlin INTRO TO RAILS June 24-27 London (Skills Matter) See http://www.rubypal.com for details and updates!