From: Sarah Allen Date: 2010-04-15T04:47:29+09:00 Subject: Re: I thought spaces didn't matter around operators Brian Candler wrote: > -@ is the unary minus method, +@ is the unary plus method. > > class Foo > def -@ > "Minused" > end > def +@ > "Plussed" > end > end This is a very helpful example. But, I still can't fully answer my original question >> 1 + 1 is the same as >> 1.send(:+, 1) >> 1 +1 is the same as...? >> 1 1.send(:+@) SyntaxError: compile error (irb):8: syntax error, unexpected tINTEGER, expecting $end 1 1.send(:+@) ^ from (irb):8 nope. So, in what way is 1 +2 not like 1 +t (where t is a Time object). I know 2 is a FixNum, but why is that significant? Specifically, how is the expression evaluated to make 1 +1 work? >> t = 2 => 2 >> 1 +t => 3 >> t = Time.now => Wed Apr 14 12:46:30 -0700 2010 >> 1 +t TypeError: Time can't be coerced into Fixnum from (irb):19:in `+' from (irb):19 Thanks! Sarah -- Posted via http://www.ruby-forum.com/.