From: Daniel Carrera Date: 2003-02-09T09:33:36+09:00 Subject: Re: help overloading operators I'm still having trouble overloading operators. Here is a minimal example that produces the error. Perhaps someone can discern the problem. $ cat test.rb class Poly end class Fixnum alias plus + def +(other) other.kind_of?(Poly) ? other.+(self) : self.plus(other) end end $ irb >> require 'poly' => true >> require 'complex' => true >> 2 + Complex(1,1) NoMethodError: undefined method `plus' for # from ./poly.rb:122:in `plus' from ./poly.rb:122:in `+' from (irb):3 from :0 >> -- Daniel Carrera Graduate Teaching Assistant. Math Dept. University of Maryland. (301) 405-5137