X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fmodule.lisp;h=83f129d716fdda520fffbe5239c6382a7217318b;hb=64a7331285b0eab2c216f52670763c7d192cfdaa;hp=77fe18b5b80149cc607d7fa3735f9ae4992d64d6;hpb=edc8da40fb17de047e290ed6bd819e096e435dc9;p=sbcl.git diff --git a/src/code/module.lisp b/src/code/module.lisp index 77fe18b..83f129d 100644 --- a/src/code/module.lisp +++ b/src/code/module.lisp @@ -42,29 +42,36 @@ needs to be. If PATHNAMES is not supplied, functions from the list *MODULE-PROVIDER-FUNCTIONS* are called in order with MODULE-NAME as an argument, until one of them returns non-NIL." - (unless (member (string module-name) *modules* :test #'string=) - (cond (pathnames - (unless (listp pathnames) (setf pathnames (list pathnames))) - ;; ambiguity in standard: should we try all pathnames in the - ;; list, or should we stop as soon as one of them calls PROVIDE? - (dolist (ele pathnames t) - (load ele))) - (t - (unless (some (lambda (p) (funcall p module-name)) - sb!ext::*module-provider-functions*) - (error "Don't know how to load ~A" module-name)))))) - + (let ((saved-modules (copy-list *modules*))) + (unless (member (string module-name) *modules* :test #'string=) + (cond (pathnames + (unless (listp pathnames) (setf pathnames (list pathnames))) + ;; ambiguity in standard: should we try all pathnames in the + ;; list, or should we stop as soon as one of them calls PROVIDE? + (dolist (ele pathnames t) + (load ele)) + ;; should we do this? Probably can't hurt, while we're + ;; taking the above view of "load everything"... though + ;; maybe having REQUIRE directly call PROVIDE is + ;; aesthetically suboptimal. + (provide module-name)) + (t + (unless (some (lambda (p) (funcall p module-name)) + sb!ext::*module-provider-functions*) + (error "Don't know how to load ~A" module-name))))) + (set-difference *modules* saved-modules))) ;;;; miscellany (defun module-provide-contrib (name) - "Stringify and downcase NAME if it is a symbol, then attempt to load - the file $SBCL_HOME/name/name" - (let ((name (if (symbolp name) (string-downcase (symbol-name name)) name))) + "Stringify and downcase NAME, then attempt to load the file + $SBCL_HOME/name/name" + (let ((filesys-name (string-downcase (string name)))) (load - (merge-pathnames (make-pathname :directory (list :relative name) - :name name) + (merge-pathnames (make-pathname :directory (list :relative filesys-name) + :name filesys-name) (truename (posix-getenv "SBCL_HOME"))))) - (provide name)) + (provide name) + t)