From: Rick DeNatale Date: 2007-06-15T01:21:46+09:00 Subject: Re: Globals not incrementing inside block On 6/14/07, Ivan Salazar wrote: > On Jun 7, 2:15 pm, "Rick DeNatale" wrote: > > May I have the temerity to point out that there's another subtle > > misconception in this statement which I see a lot of Ruby nubies trip > > up on, and that's thinking that variables are objects. > > > > An object holds state and behavior, a variable references an object. > I agree with you, that is also a frequent misconception. > > >In brief, to modify an object you make a call to a method with > >side effects or reassign the object to the new one created after the method > >call. > > The one above should read: "or reassign the variable to the new object > created". > (I don't know what happened, maybe I got confused while writing or it > was just > my good-old stupidity XD) Just nit-picking but even with that change, it's still not quite right, reassigning a variable doesn't modify the object it previously referenced. -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/