From: pongba Date: 2007-09-03T10:35:13+09:00 Subject: Re: How does ruby handle overloading? On Sep 2, 9:25 pm, Sebastian Hungerecker wrote: > 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: sep...@jabber.org > ICQ: 205544826 But isn't type-switch generally believed to be a bad thing?