I think I'm right in saying that a OOP does not require method overloading?

It's not needed for inheritance.
It's not needed for polymorphism.

Whether it's *useful*, or just confusing (or both!) is another thing
entirely.  I'm not experienced enough in OOP to express an opinion.

The author of the language obviously has an opinion, though: Ruby
allows you to redefine operators, but you can't have multiple
definitions of the same method in the same class.

Given that Ruby is typeless, I'm not sure how it would be otherwise.



On Wed, Jul 30, 2008 at 2:13 PM, Jeff Moore <jcmoore / pressenter.com> wrote:
> Sunny Bogawat wrote:
>> Hi,
>>
>> ruby is object oriented language then how overloading is not possible in
>> ruby?
>> I want same method name with different parameters but it not work in
>> ruby?
>
> def ovl(*a)
>  p a
> end
>
> ovl(99)
> => [99]
>
> ovl('66')
> => ["66"]
>
> ovl(99, '66')
> => [99, "66"]
>
> ovl(66, '66',:parm1=>11, :parm2=> 33)
> => [66, "66", {:parm2=>33, :parm1=>11}]
>
> def ovl2(a)
>  p a
> end
>
> ovl2(:parm1=>11, :parm2=> 33)
> => {:parm2=>33, :parm1=>11}
> --
> Posted via http://www.ruby-forum.com/.
>
>



-- 
Me, I imagine places that I have never seen / The colored lights in
fountains, blue and green / And I imagine places that I will never go
/ Behind these clouds that hang here dark and low
But it's there when I'm holding you / There when I'm sleeping too /
There when there's nothing left of me / Hanging out behind the
burned-out factories / Out of reach but leading me / Into the
beautiful sea