From: Brian Candler Date: 2003-02-09T18:41:04+09:00 Subject: Re: Help overloading Fixnum#+ On Sun, Feb 09, 2003 at 09:14:23AM +0900, Daniel Carrera wrote: > I'm trying to overload Fixnum#+, but I am getting what seems to be a > recursion (see below). Does anyone know what that happens? Perhaps I > don't know how "alias" works. > > $ cat >test.rb > class Fixnum > alias plus + > def +(other) > puts "hello" > self.plus(other) > end > end Try puts "Adding #{self} to #{other}" to see other additions going on in irb :-) It doesn't do this if you run it as a standalone script. Regards, Brian.