From: SpringFlowers AutumnMoon Date: 2007-09-22T22:26:35+09:00 Subject: Re: foo || 0 will cause exception but not for himself 7stud -- wrote: > if false > foo = 10 > end > > puts foo #nil i see... so after if false foo = 10 end now, bar = foo || 0 will run. Since for instance methods, the setter method can be foo=() so how about just a method not inside a class, can it be named "foo=" as well? if so, how does Ruby know foo=1 is really an assignment or a method call foo=(1)? Ruby doesn't seem to like "foo=" as a method: def foo=(i) p "ha", i+1 end def bar?(i) i % 10 end p foo=(1) p foo p bar?(22) it will print out 1 1 2 -- Posted via http://www.ruby-forum.com/.