From: Joel VanderWerf Date: 2002-09-11T07:33:10+09:00 Subject: Re: Larry Wall's comments on Ruby Christoph wrote: > "Yukihiro Matsumoto" wrote in > .... > >>Multi-method is kinda like multiple inheritance. It is *natural* >>extension of the original concept. It is theoretically clean. But it >>is easy to make thing too complex with them. Only smart people can >>use their full power. If you see no problem, it's because you're > > > Why, shouldn't I use something if I am not smart enough to use (or > understand) it to its fullest extend. A lot of people are using C++, Pythons > multiple inheritance and I doubt that they are all geniuses ... > > >>smarter than me. ;-) > > > I guess not seeing any problems translates into being foolish (well > I am a complete fool anyway;-) ... seriously trying to bolt multi-dispatch > onto Ruby might turn out to be a complete disaster or something > really wonderful? It might be interesting to write a GenericFunction class in ruby to which you can add member methods (actually, procs). A generic functions would be callable like a proc, and would dispatch to the member methods based on the tuple of argument types. You can assign them to constants in a module to approximate the behavior of CLOS. Of course this wouldn't help in the infix case that's been discussed, but there have been situations in my Ruby code where I would use such a beast.