From: Paul Pladijs Date: 2001-03-18T09:08:50+09:00 Subject: [ruby-talk:12798] Re: Math package > ----- Original Message ----- > From: "ts" > > You can have multi-dispatch if you write > > > > class Object2 > > def mself(Float a, Float b) > > # work with 2 float > > end > > > > def mself(Float a, Numeric b) > > # work with float and numeric > > end > > > > def mself(Object a, Object b) > > # work with all other objects > > end > > end > > In which version of Ruby does this work? > I get "formal argument cannot be a constant" > > Brent Certainly not in the versions 1.4 and 1.6. A while ago someone proposed an extention where you could specify the type of the formal parameters of a method. It has never been approved. Regards, Paul.