- (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)))