From: Gavin Sinclair Date: 2003-09-13T10:26:20+09:00 Subject: Re: Mthod redefinition On Saturday, September 13, 2003, 10:44:02 AM, Meino wrote: > From: Austin Ziegler > Subject: Re: Mthod redefinition > Date: Sat, 13 Sep 2003 07:38:09 +0900 > Hi > Thank you for the explanation of duck typing ! > Now I have understood, what these little ducks have to do with ruby > programming. > Would it be correct if I would say: Duck typing is more or less > equal to providing the code for calling the "same" method of > different signatures be hand while C++ and other OOP-languages will > do this automagically while compiling the code ? There's no magic really. In Ruby, you can only have one definition of a method. I think it's pretty ugly to have code inside a method picking apart the arguments and performing different behaviours. Sometimes it's unavoidable, sometimes it's OK, but mostly I try a different approach. Gavin