[slime-devel] A little swank.asd/swank-loader.lisp rectification.

Samium Gromoff _deepfire at feelingofgreen.ru
Thu Nov 29 03:51:20 UTC 2007


Good day folks,

The patch below rectifies the swank.asd, making the
ASDF load flow more natural.

The per-implementation file constellation definition is
moved into a separate file, used by both the ASDF and
slime-loader methods.

Tested both ways on SBCL with CVSly fresh Swank.

regards, Samium Gromoff


diff a/file-constellation.lisp-expr b/file-constellation.lisp-expr
--- /dev/null
+++ b/file-constellation.lisp-expr
@@ -0,0 +1,10 @@
+#+cmu ("swank-source-path-parser" "swank-source-file-cache" "swank-cmucl")
+#+scl ("swank-source-path-parser" "swank-source-file-cache" "swank-scl")
+#+sbcl ("swank-source-path-parser" "swank-source-file-cache" "swank-sbcl" "swank-gray")
+#+openmcl ("metering" "swank-openmcl" "swank-gray")
+#+lispworks ("swank-lispworks" "swank-gray")
+#+allegro ("swank-allegro" "swank-gray")
+#+clisp ("xref" "metering" "swank-clisp" "swank-gray")
+#+armedbear ("swank-abcl")
+#+cormanlisp ("swank-corman" "swank-gray")
+#+ecl ("swank-ecl" "swank-gray")
diff a/swank-loader.lisp b/swank-loader.lisp
--- a/swank-loader.lisp
+++ b/swank-loader.lisp
@@ -32,20 +32,10 @@
   "The directory where to look for the source.")
 
 (defparameter *sysdep-files*
-  (append
-   '()
-   #+cmu '("swank-source-path-parser" "swank-source-file-cache" "swank-cmucl")
-   #+scl '("swank-source-path-parser" "swank-source-file-cache" "swank-scl")
-   #+sbcl '("swank-source-path-parser" "swank-source-file-cache"
-            "swank-sbcl" "swank-gray")
-   #+openmcl '("metering" "swank-openmcl" "swank-gray")
-   #+lispworks '("swank-lispworks" "swank-gray")
-   #+allegro '("swank-allegro" "swank-gray")
-   #+clisp '("xref" "metering" "swank-clisp" "swank-gray")
-   #+armedbear '("swank-abcl")
-   #+cormanlisp '("swank-corman" "swank-gray")
-   #+ecl '("swank-ecl" "swank-gray")
-   ))
+  '#.(with-open-file (s (make-pathname :directory (pathname-directory *load-truename*)
+                                       :name "file-constellation" :type "lisp-expr")
+                        :direction :input)
+       (read s)))
 
 (defparameter *implementation-features*
   '(:allegro :lispworks :sbcl :openmcl :cmu :clisp :ccl :corman :cormanlisp
diff a/swank-sbcl.lisp b/swank-sbcl.lisp
--- a/swank-sbcl.lisp
+++ b/swank-sbcl.lisp
@@ -22,7 +22,8 @@
 
 (declaim (optimize (debug 2) (sb-c:insert-step-conditions 0)))
 
-(import-from :sb-gray *gray-stream-symbols* :swank-backend)
+(unless (find-symbol (symbol-name (first *gray-stream-symbols*)) :swank-backend)
+  (import-from :sb-gray *gray-stream-symbols* :swank-backend))
 
 ;;; backwards compability tests
 
diff a/swank.asd b/swank.asd
--- a/swank.asd
+++ b/swank.asd
@@ -24,24 +24,16 @@
 
 (in-package :swank-loader)
 
-(defclass cl-script-file (asdf:source-file) ())
-
-(defmethod asdf:perform ((o asdf:compile-op) (f cl-script-file))
-  t)
-(defmethod asdf:perform ((o asdf:load-op) (f cl-script-file))
-  (mapcar #'load (asdf:input-files o f)))
-(defmethod asdf:output-files ((o asdf:compile-op) (f cl-script-file))
-  nil)
-(defmethod asdf:input-files ((o asdf:load-op) (c cl-script-file))
-  (list (asdf:component-pathname c)))
-(defmethod asdf:operation-done-p ((o asdf:compile-op) (c cl-script-file))
-  t)
-(defmethod asdf:source-file-type ((c cl-script-file) (s asdf:module))
-  "lisp")
-
 (asdf:defsystem :swank
-    :default-component-class cl-script-file
-    :components ((:file "swank-loader")))
+  :serial t
+  :components #.(append
+                 '((:file "swank-backend"))
+                 (mapcar (lambda (file) `(:file ,file))
+                         (with-open-file (s (make-pathname :directory (pathname-directory *load-truename*)
+                                                           :name "file-constellation" :type "lisp-expr")
+                                            :direction :input)
+                           (read s)))
+                 '((:file "swank"))))
 
 (defparameter *source-directory*
   (asdf:component-pathname (asdf:find-system :swank)))



More information about the slime-devel mailing list