Hi! Rather new to ruby, and I'm not quite sure where to look for the
information I want.
In C++ it's possible to have function overloading... ie
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
or is there any other way to do this?
....or perhaps a way to do the functional equivalent of C++s
class rational
{
rational(int a) { ... } // conversion constructor
}
void foo(rational a) should now work for foo(3)
--
Eld péÓen og sol peng gjer mannen fegen og fjéÈ. [Jøôul] /o)\
<demo> 2004 Tore Halvorsen || Cell: +052 0553034554 \(o/