Welcome! Please see the About page for a little more info on how this works.

0 votes
in Spec by
edited by

Hello, As of 2016 spec fdef did not support multimethods. Has this officially changed?

Although it seemed to work at first -- I was able to instrument and test a multimethod with fdef -- I later hit an issue using get-method on said multimethod after I instrumented it.

I could make a test case for the get-method instrumentation issue,but I thought I'd first clear up if this multimethod fdef usage is even supposed to work :-)

1 Answer

0 votes
selected by
Best answer

From what I can tell, fdef does seem to work fine with multimethods, although if you're going to use get-method on an instrumented multimethod you need to keep around a reference/binding to the original multimethod before it gets wrapped by instrument, and call get-method on that original. (This is arguably as designed/documented since instrumenting expressly replaces the original fn. It would be neat if instrumenting wrapped each method within the multi rather than sitting (as it seems) above the dispatch, but the folks who built instrumenting have probably thought more about this than I have....)