[slime-devel] Putting FASLs compiled from emacs in the same place as ASDF

John Fremlin jf at msi.co.jp
Mon Mar 9 04:46:34 UTC 2009


For a while I patched SLIME so that it would put FASLs in the same place
as ASDF was told to put them. This keeps miscellaneous .fasls from
cluttering up source directories.

The way it did this was to modify all the swank-${impl}.lisp files. Now
I have been pleasantly surprised to see that the compile output-file has
been very decently abstracted away.

It isn't perfect but it at least supports the customisations by Debian's
common-lisp-controller::alternative-root-path-to-fasl-path.

Can I suggest this replacement for fasl-pathname? Or at least that a
convenient way of allowing a similar customization be integrated? (Maybe
allow *fasl-directory* to be a function?)

(defun fasl-pathname (input-file options)
  (cond ((getf options :fasl-directory)
         (let* ((str (getf options :fasl-directory))
                (dir (filename-to-pathname str)))
           (assert (char= (aref str (1- (length str))) #\/))
           (compile-file-pathname input-file :output-file dir)))
        (*fasl-directory*
         (compile-file-pathname input-file :output-file *fasl-directory*))
        (t
         (or (ignore-errors
               (first (asdf:output-files (make-instance 'asdf:compile-op) 
                                         (make-instance 'asdf:cl-source-file :name (pathname-name (pathname input-file))
                                                        :parent (make-instance 'asdf:module :pathname nil :name "")
                                                        :pathname nil))))
             (compile-file-pathname input-file)))))




More information about the slime-devel mailing list