From: Ryan Davis Date: 2009-02-27T04:34:04+09:00 Subject: Re: "def nothing=(data) false end" returns 'data' instead of 'false' On Feb 26, 2009, at 07:09 , Ken Bloom wrote: > Because when you use test.nothing=123, you're not directly calling the > method -- you're acutally doing an assignment operator, which calls > the > nothing= internally. The assignment operator always returns the > value on > the right side, and the return value from nothing= is ignored. to go one level deeper on Ken's explanation: > % echo "attr_accessor :x; self.x = 42" | parse_tree_show > s(:block, > s(:call, nil, :attr_accessor, s(:arglist, s(:lit, :x))), > s(:attrasgn, s(:self), :x=, s(:arglist, s(:lit, 42)))) the attrasgn node does the call and returns the value of the arglist regardless of the call's return value(s).