From: Robert Feldt Date: 2001-10-16T01:40:50+09:00 Subject: [ruby-talk:22578] Re: Fixnum Arithmetic operations NameError On Tue, 16 Oct 2001, Robert Linder wrote: > Here is the problem: > Fixnum = Fixnum+Fixnum causes a > NameError > > Fixnum = Fixnum+Fixnum NO ERROR > Fixnum = Fixnum+Fixnum NO ERROR > Same happens on '-','*'. I did not check the rest. > > ============================================== > irb(main):001:0> xx=0 > 0 > irb(main):002:0> xx = xx + 1 > 1 > irb(main):003:0> xx = xx +1 > NameError: undefined method `xx' for > # > from (irb):3 > Ruby assumes its a method call to method :xx with argument 1. This is in order to allow your_method arg1 as a substitute for your_method(arg1) Regards, Robert