[slime-devel] Patch: Fix defmethod arglist when using closer-mop

Max Mikhanosha max at openchat.com
Mon Oct 3 00:36:12 UTC 2011


Anton Kovalenko wrote:
> 
> Max Mikhanosha <max at openchat.com> writes:
> 
> > Message area displays: "(defmethod name &body body)
> > Expected result is: "(defmethod stream-read-char (stream) &body body)
> >
> 
> The problem is real, but the fix below may be improved: as it is, it
> depends on closer-mop being loaded before swank is compiled.
> We could avoid this unfortunate requirement by looking up closer-mop
> package dynamically (probably in :around method).

Redone using around method, works when closer-mop is loaded after
slime... See next email also that implements same thing for (def
(method flags)) type packages, not for inclusion but just as a snippet
if someone has same problem.

*** swank-arglists.lisp.~1.70.~	2011-06-06 10:02:49.000000000 -0400
--- swank-arglists.lisp	2011-10-02 20:29:03.348728948 -0400
***************
*** 1544,1547 ****
--- 1544,1556 ----
  (test-print-arglist)
  (test-arglist-ref)
  
+ (defmethod arglist-dispatch :around ((operator t) arguments)
+   (let* ((closer-package (find-package :closer-mop))
+          (closer-defmethod (when closer-package
+                              (find-symbol (symbol-name 'cl:defmethod)
+                                           closer-package))))
+     (if (eq operator closer-defmethod)
+         (arglist-dispatch 'cl:defmethod arguments)
+         (call-next-method))))
+ 
  (provide :swank-arglists)




More information about the slime-devel mailing list