From 371e391c20b836395dbc99fc762aecac8d60482f Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Fri, 12 Oct 2007 02:00:24 +0000 Subject: [PATCH] Implement WITH-CURRENT-LOAD-ENVIRONMENT. --- v7/src/runtime/load.scm | 7 ++++++- v7/src/runtime/runtime.pkg | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/v7/src/runtime/load.scm b/v7/src/runtime/load.scm index 8b0d420b2..dd32fc968 100644 --- a/v7/src/runtime/load.scm +++ b/v7/src/runtime/load.scm @@ -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 diff --git a/v7/src/runtime/runtime.pkg b/v7/src/runtime/runtime.pkg index 134c1874e..98afd5c47 100644 --- a/v7/src/runtime/runtime.pkg +++ b/v7/src/runtime/runtime.pkg @@ -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) -- 2.25.1