From: Igor Pirnovar Date: 2009-02-27T00:29:21+09:00 Subject: Re: "def nothing=(data) false end" returns 'data' instead of 'false' Ken Bloom wrote: > Because when you use test.nothing=123, you're not directly calling the > method -- you're acutally doing an assignment operator, Precisely! > def x= ; ... end is really assignment operator definition and not a normal message, method or a function if you like. Take away the equal sign and it will behave like you'd expect it. This does not mean that there is no bug here, however, it is highly unlikely that anyone who uses the assignment definition properly would ever see it. The bug showed up in a slightly incorrect use of this feature and I do believe should be fixed if for nothing else but for the sake of completeness, when all far more serious bugs are fixed ;) +-----------------------+ | class MyTest | | def nothing(data) | | return false | | end | | end | | o = MyTest.new | | puts o.nothing=(123) | |-----------------------| |OUTPUTS: false | +-----------------------+ -- Posted via http://www.ruby-forum.com/.