Implement WITH-CURRENT-LOAD-ENVIRONMENT.
authorChris Hanson <org/chris-hanson/cph>
Fri, 12 Oct 2007 02:00:24 +0000 (02:00 +0000)
committerChris Hanson <org/chris-hanson/cph>
Fri, 12 Oct 2007 02:00:24 +0000 (02:00 +0000)
v7/src/runtime/load.scm
v7/src/runtime/runtime.pkg

index 8b0d420b2dbe28629eae99ee0f2567b1e2b7328d..dd32fc9686f1da1b61db73f3ade376ce38226543 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: load.scm,v 14.98 2007/10/12 01:08:01 cph Exp $
+$Id: load.scm,v 14.99 2007/10/12 02:00:22 cph Exp $
 
 Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
     1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
@@ -269,6 +269,11 @@ USA.
        (nearest-repl/environment)
        env)))
 
+(define (with-current-load-environment environment thunk)
+  (guarantee-environment environment 'WITH-CURRENT-LOAD-ENVIRONMENT)
+  (fluid-let ((*current-load-environment* environment))
+    (thunk)))
+
 (define (set-current-load-environment! env)
   (if (not (eq? *current-load-environment* 'NONE))
       (begin
index 134c1874e9ab7183cf71f414b2a0aebbd4e7771f..98afd5c4736987c69097c184b516c5bbc1a9c658 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: runtime.pkg,v 14.627 2007/10/12 01:08:03 cph Exp $
+$Id: runtime.pkg,v 14.628 2007/10/12 02:00:24 cph Exp $
 
 Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
     1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
@@ -2428,6 +2428,7 @@ USA.
          simple-command-line-parser
          system-library-uri
          system-uri
+         with-current-load-environment
          with-eval-unit
          with-loader-base-uri)
   (export (runtime rep)