From: Chad Fowler Date: 2003-10-03T03:56:28+09:00 Subject: Re: newbie question: function overloading On Fri, 3 Oct 2003, Dimitrios Galanakis wrote: # I need to define a method that performs differently when operated on objects # of different type (overloading). Currently I use various if's to check for # the type of the object as follows: # There are really two answers to this: 1) Ryan Pavlik has created a library that provides overloading capability like this. You could give it a try and it might feel right to your C++ ways. 2) I would lean more heavily toward this one: The Ruby Way to accomplish what you're trying to accomplish very likely isn't to check type in this way. I remember coming to Ruby from C++/Java and wondering why I couldn't do method overloading like this. My brain was wired into the static typing way of doing things and I even felt like overloading was almost a necessary part of OO. It didn't take long before I stopped feeling the need for this capability as I started reading existing code and understanding the Ruby idioms better. Maybe if you could post a more specific example/statement of what you're trying to accomplish, we could see about helping you with option #2. Chad