From: "Hal E. Fulton" Date: 2002-09-12T01:26:42+09:00 Subject: Re: Multimethods (was Re: Larry Wall's comments on Ruby) ----- Original Message ----- From: "Dan Sugalski" To: "ruby-talk ML" Sent: Wednesday, September 11, 2002 9:56 AM Subject: Multimethods (was Re: Larry Wall's comments on Ruby) > At 10:48 PM +0900 9/11/02, Gavin Sinclair wrote: > >Despite the discussion and links, I haven't picked up on what multimethods > >actually are, so I can't comment on those. (snip informative stuff} > 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) That's it? I thought it would be more esoteric and interesting. Do people really consider that a "multiple-receiver" model?? I had envisioned some kind of bizarre framework where you could do (obj1,obj2).method in an order-independent fashion. In any case, I wouldn't favor adding this to Ruby, as variables have no types; and thus how do you define a method "signature"? What's more, a method with a single parameter can be passed an object of ANY type. I'd hate to define a method for each type I expected (as I would in C++ or Java), especially since that would preclude types I *didn't* expect. Example: If a method does nothing to its parameter but invoke the << operator, I might expect that it would work on strings and arrays. But it would also work on files, whether I planned that or not. Hal