[slime-devel] swank reloading problem

Cyrus Harmon ch-slime at bobobeach.com
Fri Jun 2 19:42:38 UTC 2006


On further examination, the problem is that swank-backend gets  
reloaded, causing the definterface forms to fire again, which  
overwrites the existing methods. The following patch checks to see if  
the symbol is fbounp before doing the defgeneric and gen-default-impl  
stuff.

Cyrus

--- swank-backend.lisp	20 Apr 2006 16:48:23 -0700	1.98
+++ swank-backend.lisp	21 May 2006 17:22:01 -0700	
@@ -114,15 +114,16 @@
    (check-type documentation string "a documentation string")
    (flet ((gen-default-impl ()
             `(defmethod ,name ,args , at default-body)))
-    `(progn (defgeneric ,name ,args (:documentation ,documentation))
-            (pushnew ',name *interface-functions*)
-            ,(if (null default-body)
-                 `(pushnew ',name *unimplemented-interfaces*)
-                 (gen-default-impl))
-            ;; see <http://www.franz.com/support/documentation/6.2/ 
doc/pages/variables/compiler/s_cltl1-compile-file-toplevel- 
compatibility-p_s.htm>
-            (eval-when (:compile-toplevel :load-toplevel :execute)
-              (export ',name :swank-backend))
-            ',name)))
+    `(unless (fboundp ',name)
+       (progn (defgeneric ,name ,args (:documentation ,documentation))
+              (pushnew ',name *interface-functions*)
+              ,(if (null default-body)
+                   `(pushnew ',name *unimplemented-interfaces*)
+                   (gen-default-impl))
+              ;; see <http://www.franz.com/support/documentation/6.2/ 
doc/pages/variables/compiler/s_cltl1-compile-file-toplevel- 
compatibility-p_s.htm>
+              (eval-when (:compile-toplevel :load-toplevel :execute)
+                (export ',name :swank-backend))
+              ',name))))
(defmacro defimplementation (name args &body body)
    `(progn (defmethod ,name ,args , at body)

On May 21, 2006, at 5:10 PM, Cyrus Harmon wrote:

>
> I'm trying to debug getting threads running on SBCL/x86/MacOS and  
> in doing so I've come across a strange problem where something  
> (presumably clim-desktop.asd) is requiring swank, which is causing  
> swank.asd to get reloaded and swank-backend is getting recompiled,  
> which causes current-thread to get redefined to 0. This seems to  
> wreak havoc with some of the locking stuff, which presumably has  
> various locks held while it's trying to output the results of the  
> compilation. Should the definterface stuff in swank-backend have  
> some sort of check to see if these haven't been previously  
> implemented before overwriting the previous method definitions?
>
> Thanks,
>
> Cyrus
>
> _______________________________________________
> slime-devel site list
> slime-devel at common-lisp.net
> http://common-lisp.net/mailman/listinfo/slime-devel




More information about the slime-devel mailing list