From: Simon Krahnke Date: 2008-05-02T04:05:18+09:00 Subject: Re: Please explain nuances of ||= * David A. Black (18:56) schrieb: > Hi -- > > On Fri, 2 May 2008, Ruby Freak wrote: > >> I am reading some of the ruby files in rails and I an seeing the ||= >> method used a lot. >> knowing ruby the way I do, I realize that she has lots of magical >> surprises and I really want to get to know this girl! > > x ||= y means: x || x = y No, it means: x = x || y > The difference is that x ||= y won't complain if x is undefined, That's because = does the same. mfg, simon .... l