On Wed, 7 Feb 2001, ts wrote: > >>>>> "R" == Robert Feldt <feldt / ce.chalmers.se> writes: > > R> Is this a brand new addition to Ruby (generic/overlaoded methods)? Doesn't > R> work in my 1.7.0 2001-01-31 version. Is it in the CVS? > > No, it's my toy :-) > > I was just looking was modification must be made to ruby if you want to > try to implement it. > Ok, always on the leading edge... ;-) > R> Seems like a major deviation from up-to-now Ruby philosophy (even though > R> it might make things easier for compiling to fast native code... ;-)) > > why ? > Well, I find specifying types in a dynamically typed language pretty wild! But I guess its not very much different from querying obj.type dynamically. Is the semantics of class K def m(T a) end def m(T2 a) end end equivalent to class K def m(a) if a.type == T # Code for m(T a) elsif a.type == T2 # Code for m(T2 a) else raise "" end end end ? Or what do you do if a is not T or T2? /R