From: Dan Sugalski Date: 2002-09-12T15:35:16+09:00 Subject: Re: Multimethods (was Re: Larry Wall's comments on Ruby) At 12:57 AM +0900 9/12/02, Christoph wrote: >"Dan Sugalski" wrote in >.... >> That's pretty much multimethods. They're terribly useful, as they cut >> out a lot of checks for the second type in methods. (Checks which >> tend to be slow, error prone, and missing stuff) > >Thanks Dan, for making such an eloquent case for multimethods. >Personal I cannot image (surely an effect of being single and >simple minded;-) how their use could be less complex then the >alternatives like Rubys coerce framework or double-dispatch .. Their big problem is that they introduce methods that don't live in any class. If you have the methods: add(int, num) add(num, int) add(bignum, int) those three, while methods, don't live in any class, so if you did: foo.add(bar) you may well not be executing the add method defined in the foo class--you may be executing the one defined in the bar class, or the baz class, or maybe in some standalone code you loaded. Not, mind, that I think that's enough to make it not happen, but I'm not a language designer. :) -- Dan --------------------------------------"it's like this"------------------- Dan Sugalski even samurai dan@sidhe.org have teddy bears and even teddy bears get drunk