From: Hugh Sasse Staff Elec Eng Date: 2001-06-28T00:59:45+09:00 Subject: [ruby-talk:16972] Re: Method overloading (option) Was: Re: On Thu, 28 Jun 2001, Yukihiro Matsumoto wrote: > Hi, > [...] > > I think I can live without "a good way to collect the respond_to? > tests". What situation do you think of? A situation where the code is developing, so more methods are coming into use, so that every time you use a new method you need to put a test for it up front. This has a feel like duplicate code. You have to refer to the same thing in two places for it to work properly. > > If you give an object of wrong protocol, you'll get NameError (well, I'm not sure what you mean here. (That could be because I'm implementing a 'protocol' on top of UDP at the moment, so I'm see the word differently from you! :-)) Can you give an example of how a NameError can come from passing the wrong object to a user defined method, without using type dispatch, please? This may help me see your Ruby Way. > most of the cases). If you want to override similar but little bit > different methods based on type, you can just give them different > names. Method overloading based on type IS sometimes beautiful, but > it's not must. > > matz. > Thank you, Hugh