From: 7stud -- Date: 2009-08-27T09:09:56+09:00 Subject: Re: ||= with 1.8 and 1.9 ? Brian Candler wrote: >> The method name is 'x=' and it was called using 'obj.x='. Where's the >> sugar? > > The parentheses in (10) are not delimiting arguments of a method call; > they are just bracketing a value expression. Note: > >>> class Foo; def bar=(x,y,z); 123; end; end > => nil >>> Foo.new.send(:bar=,7,8,9) > => 123 >>> Foo.new.bar=(7,8,9) > SyntaxError: compile error > (irb):3: syntax error, unexpected ',', expecting ')' > Foo.new.bar=(7,8,9) > ^ > from (irb):3 > from :0 >>> > > Similarly: > >>> Foo.new.bar= 7,8,9 > ArgumentError: wrong number of arguments (1 for 3) > from (irb):4:in `bar=' > from (irb):4 > from :0 >>> > Wow. Thanks for the explanation. . . . . . . . . .. . . -- Posted via http://www.ruby-forum.com/.