[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting hold of the method object currently executed



> So, you want a method to reason about itself while it runs?  The both
> versions of the code i sent you returns the effective method.  Is that
> what you want? [...]

Perhaps, if by effective method you mean what is in most cases
'the most specific of the applicable methods'.  If by effective
method you mean the actual code that is executed, then the effective
method is not what I'm looking for.

What I need is the method object, exactly the kind returned by
find-method (called get-method in Victoria Day PCL).

It turns out that every generic function of interest to me is called
from a macro and thus I have access to the generic-function name
and arguments before the function is called.  This is why I thought
I could use find-method BUT, as find-method would be called
with every generic-function invocation, I think it is a waste to
perform method lookup twice, once in find-method and once in the
generic function.

Martin