From: Sebastian Hungerecker Date: 2007-09-02T22:25:48+09:00 Subject: Re: How does ruby handle overloading? pongba wrote: > what concerns me is that if, for > instance, we have Matrix and Graph, and we'd like to be able to draw > both of them (the two 'draw's would have the same semantic but > different implementation logic), how 're we going to be able to > overload draw on Matrix and Graph like what we do in C++ or Java: > > void draw(Matrix); > void draw(Graph); def draw(arg) if arg.is_a? Matrix do_stuff elsif arg.is_a? Graph do_other_stuff end end HTH, Sebastian -- NP: Dream Theater - Honor Thy Father Jabber: sepp2k@jabber.org ICQ: 205544826