From: "David A. Black" Date: 2008-05-02T03:10:53+09:00 Subject: Re: References in Ruby Hi -- On Fri, 2 May 2008, Stephen Cox wrote: > David A. Black wrote: >> Hi -- >> >> On Thu, 1 May 2008, marc wrote: >> >>>> Why?? Since everything is a reference in Ruby I expected "puts 50". >>> >>> The way I think of it is that 10 and 50 are objects. >> >> And indeed they are :-) >> >> >> David > > Wait, I'm a noob. And I see it this way: > > a = 10 > b = a # b is NOW 10 > a = 50 # what's that got to do with B? B has already been assigned. > > I know I'm came to the same answer, but am I thinking this through the > right way? Yes, I think you are. 10 and 50 are objects (of class Fixnum). The changing of the binding of a from 10 to 50 has no effect on the binding of b to 10. 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!