From: Wes Gamble Date: 2007-01-13T00:31:00+09:00 Subject: Re: Why doesn't Ruby allow for overloaded methods within a c Max Lapshin wrote: > Wes Gamble wrote: >> but I'm looking for a simple explanation of why Ruby doesn't support >> method overloading within a class to allow methods with the same name >> but different numbers of arguments. I understand that you can't do > > You see, almost none of dynamic languages support this feature because > of real problems with detecting, which method to use. > > class Foo > def methodname(x, y) > end > > def methodname(x, *args) > end > end > > Which to use in case of Foo.new.methodname(1,2) ? Max, Thanks, I hadn't considered that. Wes -- Posted via http://www.ruby-forum.com/.