From: Joel VanderWerf Date: 2008-04-06T02:57:21+09:00 Subject: Re: The ||= assignment operator David A. Black wrote: > The only time this matters is with hashes that have default values. In > every other case, as far as I know, x = x || y also describes what's > happening. But the expansion which describes *every* case is x || x = > y. One other case (a very similar one) in which it matters is this: class C def x; @x || 5; end def x=(v); puts "assigning @x=#{v}"; @x = v; end end c = C.new c.x ||= 3 # no effect p c.x # 5 c.x = 2 # assigning @x=2 p c.x # 2 -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407