develooper Front page | perl.perl6.language | Postings from September 2001

Re: Multiple-dispatch on functions

Thread Previous | Thread Next
From:
Dan Sugalski
Date:
September 1, 2001 10:07
Subject:
Re: Multiple-dispatch on functions
Message ID:
5.1.0.14.0.20010901125709.01fcc720@tuatha.sidhe.org
At 04:35 PM 8/31/2001 -0500, Me wrote:
>Dan, I don't immediately see how per object/class dispatch
>control helps to make multimethods pluggable.

There's going to be a "method call" entry in the variable's vtable. You 
want a different method call method, you change the entry. Probably by 
changing the class shared vtable.

Globally overriding the "leftmost depth-first" (or breadth-first dispatch, 
or dispatch with automatic redispatch) dispatch method's certainly 
possible, and I know Damian'd like to do it, but I don't like the thought 
of throwing in another level of indirection on a method call. Yeah, I know, 
it's only a single extra pointer deref, and compared to the rest of the 
code it's not much of a performance loss, but we have a lot of places where 
it's "Just one more level of indirection" and those little pieces will 
ultimately add up.

Not to say we won't, but I make it a point to question these decisions. 
That way folks take the performance implications into account. I don't mind 
*doing* them, mind, but I want people to think about the costs when 
deciding the value of the feature.

					Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
dan@sidhe.org                         have teddy bears and even
                                      teddy bears get drunk


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About