method-combination-utilities icon indicating copy to clipboard operation
method-combination-utilities copied to clipboard

Method-combination-expand fails

Open PuercoPop opened this issue 11 years ago • 3 comments

(method-combination-utilities:method-combination-expand (print-object 1 t))

From what I can see the problem is that `(defun method-combination-expander-function (method-combination)`` returns nil

The function COMMON-LISP:NIL is undefined.
   [Condition of type UNDEFINED-FUNCTION]

PuercoPop avatar Oct 12 '14 04:10 PuercoPop

Thanks for opening the first issue!

What CL impl are you using? I think that method-combination-expander-function can only be expected to work on combinations defined with the long form of define-method-combination. However, I think I could fake method-combination-expand for built-in and short-form method combinations. I would also signal a warning that it’s fake, so while the expansion should give you some idea, it’s not necessarily what the implementation is actually doing.

Of course, bare minimum is to signal a more appropriate error. I’ll make that change and keep this open for trying to handle more cases.

sellout avatar Oct 12 '14 17:10 sellout

I'm using SBCL, I was unaware it was only supposed to work for a subset of method combinations I thought it was like asdf's make-plan for method combinations.

PuercoPop avatar Oct 12 '14 22:10 PuercoPop

Well, ideally it would work for all of them. However, the short-form and built-ins aren’t defined using a function and so they can be handled specially, with the implementation only needing to hold onto a function for long-form combinations. It’s not out of the question that some implementation may have an expander for every combination, but clearly SBCL and CCL don’t. As I mention in the README, the short form (and built-ins based on it) are unnecessary complexity in the spec.

It would be nice if implementations provided some way to get an expander function for all combinations, but I have to work with what’s there.

sellout avatar Oct 13 '14 03:10 sellout