(mapc 'require '(sb-bsd-sockets sb-posix sb-introspect sb-cltl2 asdf asdf-install)) (asdf:operate 'asdf:load-op :cl-ppcre) (defun bt (&rest rest) (apply #'backtrace rest)) (defun mxp1 (&rest rest) (apply #'macroexpand-1 rest)) (defvar *user-load-list* nil) (let ((last-load (get-universal-time))) (defun load* (&optional file-list) "The file names in FILE-LIST should not have extensions." (if (listp file-list) (if (null *user-load-list*) (setf *user-load-list* file-list) (nconc *user-load-list* file-list))) (dolist (file *user-load-list*) (let ((lisp-file (concatenate 'string file ".lisp")) (fasl-file (concatenate 'string file ".fasl"))) (flet ((newer-than-last-load (f) (> (file-write-date f) last-load)) (newer-than (f1 f2) (> (file-write-date f1) (file-write-date f2)))) ;; if there's a compiled version of the file around (if (probe-file fasl-file) ;; if the fasl is newer than the lisp and is newer than the last ;; time we loaded, load it (if (and (newer-than fasl-file lisp-file) (newer-than-last-load fasl-file)) (load fasl-file) ;; otherwise, if the lisp is newer then compile & load it (if (newer-than-last-load lisp-file) (load (compile-file fasl-file)))) ;; there is no fasl, so if the lisp is newer then load it (if (newer-than-last-load lisp-file) (load lisp-file)))))) (setf last-load (get-universal-time)) t)) ;;; If the fasl was stale, try to recompile and load (once). Since only SBCL ;;; has a separate condition for bogus fasls we retry on any old error ;;; on other lisps. Actually, Allegro has a similar condition, but it's ;;; unexported. Works nicely for the ACL7 upgrade, though. (defmethod asdf:perform :around ((o asdf:load-op) (c asdf:cl-source-file)) (handler-case (call-next-method o c) (#+sbcl sb-ext:invalid-fasl #+allegro excl::file-incompatible-fasl-error #-(or sbcl allegro) error () (asdf:perform (make-instance 'asdf:compile-op) c) (call-next-method)))) (sb-ext:save-lisp-and-die "sbcl.core")