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.