load modules from within a known environment
authorAndy Wingo <wingo@pobox.com>
Wed, 16 Jun 2010 07:38:36 +0000 (09:38 +0200)
committerAndy Wingo <wingo@pobox.com>
Wed, 16 Jun 2010 07:38:36 +0000 (09:38 +0200)
* module/ice-9/boot-9.scm (try-module-autoload): Init the module
  excursion with a fresh user module.

module/ice-9/boot-9.scm

index 8d04323..450a6e4 100644 (file)
@@ -2598,6 +2598,9 @@ module '(ice-9 q) '(make-q q-length))}."
               (with-fluids ((current-reader #f))
                 (save-module-excursion
                  (lambda () 
+                   ;; The initial environment when loading a module is a fresh
+                   ;; user module.
+                   (set-current-module (make-fresh-user-module))
                    (if version
                        (load (find-versioned-module
                               dir-hint name version %load-path))