>>>>> "L" == Luigi Ballabio <luigi.ballabio / riskmap.net> writes:

 Add

>> class One
>>    def + (x)
>>       x+1
>>    end

      def coerce(x)
         [x, 1]
      end

>> end

L> Sort of __radd__ in Python?

 it will work also with '3 * one' and 'one * 3' if you define 'def *(x)'
 (or with -)

 You have a more complete example in Complex.rb


Guy Decoux