[slime-devel] compile-file-if-needed fails if fasl already exists (Clozure)

Derrell Piper ddp at electric-loft.org
Tue Nov 3 13:26:09 UTC 2009


If I try to compile and load a file that's already compiled in  
Clozure, say doing this twice:

   (swank:compile-file-if-needed "/Users/ddp/src/lisp/test.lisp" t)

On the second time around, swank signals an error in swank:collect- 
notes because Clozure returns a pathname of the fasl file instead of  
T.  Clozure's behavior seems rational.  So since the underlying  
defstruct specifies :type boolean for successp, here's how I fixed this:

fluffy% diff -n swank.lisp.~1.671.~ swank.lisp
d2786 2
a2787 2
	  (let ((successp (if successp t nil)))
		(make-compilation-result (reverse notes) successp seconds)))))


(defun collect-notes (function)
   (let ((notes '()))
     (multiple-value-bind (successp seconds)
         (handler-bind ((compiler-condition
                         (lambda (c) (push (make-compiler-note c)  
notes))))
           (measure-time-interval function))
	  (let ((successp (if successp t nil)))
		(make-compilation-result (reverse notes) successp seconds)))))





More information about the slime-devel mailing list