From: dblack@... Date: 2007-07-19T05:38:09+09:00 Subject: Re: The Pebble in the Ruby Shoe Hi -- On Thu, 19 Jul 2007, Robert Dober wrote: > On 7/18/07, MenTaLguY wrote: >> On Wed, 2007-07-18 at 22:56 +0900, Robert Dober wrote: >> > > Lets not forget also that doing things for the sake of being different >> help no >> > > one. I for one must work in multiple languages. I still haven't >> forgiven Matz >> > > for the whole, "0 is true" thing. ;-) >> > That is the single best feature of Ruby once you got used to it -- >> > with "" is true!!! >> >> One of the biggest advantages to this is that it makes || and ||= > and one of its biggest dangers too, I wonder how much time has been > spent in looking for "Why has my already (with false) initialized > variable been overwritten?" > I am *not asking* that false evaluates to true, but I suggest that > > x=false > x||=42 > x --> false But x ||= 1 is really: x = x || 1. So you'd end up with, essentially, false || 1 being false, which wouldn't make sense, and sort of would be false evaluating to true :-) David -- * Books: RAILS ROUTING (new! http://www.awprofessional.com/title/0321509242) RUBY FOR RAILS (http://www.manning.com/black) * Ruby/Rails training & consulting: Ruby Power and Light, LLC (http://www.rubypal.com)