Joel VanderWerf wrote:
> True. The quirk happens with reader and writer methods as well as hashes
> (scroll down a bit in the google groups page to see some examples).

Look at the original code, though..

class OrOrEquals
attr_accessor :test
  def test
    @test
  end

  def test=(test)
    @test = test
    'not test'
  end
end

p (OrOrEquals.new.test = 'test')
# ruby 1.8 returns 'test'
# ruby 1.9 returns 'test'

p (OrOrEquals.new.test ||= 'test')
# ruby 1.8 returns 'test'
# ruby 1.9 returns 'not test'


... And compare this to what's written in that g-group:

"I also thought so, but, according to "The ruby programming language", 
it's an
exception. It states that, if the left hand of var ||= something is not 
nil or
false, no assignment is performed and, if the left hand is an array 
element or
attribute, the setter method is not called. "

Well, then... It -IS- assigning something, isn't it, since there's no 
value to @test ? Why does it return something other than the result of 
the assignment?
-- 
Posted via http://www.ruby-forum.com/.