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

Re: Multiple-dispatch on functions

Thread Previous
From:
Dan Sugalski
Date:
September 1, 2001 13:25
Subject:
Re: Multiple-dispatch on functions
Message ID:
5.1.0.14.0.20010901162500.02062b28@tuatha.sidhe.org
At 03:43 PM 9/1/2001 -0400, Michael G Schwern wrote:
>On Sat, Sep 01, 2001 at 03:12:17PM -0400, Dan Sugalski wrote:
> > Nope, the cost will be paid on all sub calls. We at least need to check on
> > every sub call to see if there are multiple versions of the functions. (We
> > can't tell at compile time if it's a single or multi-method sub call, 
> since
> > it can change at runtime) Granted, it's not a huge expense for
> > non-multi-method calls, but it does still impose an overhead everywhere.
>
>Sounds like it could be solved with a function call cache similar to
>the method call cache we have now.  Just blow it away if anything
>touches that package's symbol table.

Sure, if we do decide to do it we'll have to come up with some way to do it 
efficiently. There'll probably be a cost of some sort no matter what we do, 
though it might turn out to be paid by the core coders not the user. (Which 
is OK, but I'm trying to minimize those costs where I can too)

					Dan

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


Thread Previous


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