From: tamc2@... (Tom Counsell) Date: 2004-09-18T01:34:45+09:00 Subject: Re: Automatic class conversion / function overloading > void foo(int a) and void foo(rational a) > > Do I have to resort to > > def foo(a) > case a > when Fixnum ... > when Rational ... > end > end As I understand it, the idiom in ruby would be to, where possible, ignore the difference and assume that both a (rational) and a (fixnum) respond to the methods you want to call on them ... def increment(a) # a could be a Fixnum, Integer, Rational, Bignum whatever a += 1 # Rely on the fact that they all respond to the method + end If classes might have different methods then you could redefine them so that they all have the same method: class Integer alias :newnamefor :oldmethod end Hope that helps Tom