Closed weissjeffm closed 10 years ago
I actually tried to implement the fix for this, which led to some observations:
So that brings me back to how to solve the original problem: how do i trace multimethods? One obvious solution is to trace multimethods differently than regular functions. But seems like the trace lib and multimethod lib should not know about each other.
So what I ended up doing to trace multimethods is just change the definition of what counts as a "function" to include multimethods. The individual dispatch functions are not traced but really this only leaves out which method was selected.
If you write
then the dispatch will not be traced. You would have to re-decorate afterward. This kind of blows because it means you can't do anything to multimethod functions once they've been defined.
multimethods probably should just resolve the name of the function into the actual function object, every time it's called. slow, but less surprising behavior.