From: matz@... (Yukihiro Matsumoto) Date: 2001-06-28T00:19:06+09:00 Subject: [ruby-talk:16970] Re: Method overloading (option) Was: Re: Hi, In message "[ruby-talk:16965] Re: Method overloading (option) Was: Re:" on 01/06/27, Hugh Sasse Staff Elec Eng writes: |Because of modules, an object with given type may have methods mixed in, |so type() tests are inadequate anyway. So what do you see as the |elegant, ruby way of overcoming this problem? Are you saying there |is a way without dispatching on type or on "responds_to?", when you |talk about protocols? Or are you saying there is a good way to collect |the "responds_to?" tests together, neatly? I think I can live without "a good way to collect the respond_to? tests". What situation do you think of? If you give an object of wrong protocol, you'll get NameError (well, 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.