#| -*-Scheme-*-
-$Id: load.scm,v 14.99 2007/10/12 02:00:22 cph Exp $
+$Id: load.scm,v 14.100 2007/10/12 02:12:11 cph Exp $
Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
(define (wrap-loader pathname loader)
(lambda (environment purify?)
(lambda ()
- (fluid-let ((*current-load-environment* environment))
- (with-eval-unit (pathname->uri pathname)
- (lambda ()
- (loader environment purify?)))))))
+ (with-load-environment environment
+ (lambda ()
+ (with-eval-unit (pathname->uri pathname)
+ (lambda ()
+ (loader environment purify?))))))))
\f
(define (fasload pathname #!optional suppress-notifications?)
(receive (pathname* loader notifier) (choose-fasload-method pathname)
(thunk)))
\f
(define (with-eval-unit uri thunk)
- (fluid-let ((*eval-unit* (->absolute-uri uri 'WITH-EVAL-UNIT)))
- (thunk)))
+ (let ((uri (->absolute-uri uri 'WITH-EVAL-UNIT)))
+ (fluid-let ((*eval-unit* uri))
+ (let ((pathname (uri->pathname uri #f)))
+ (if pathname
+ (with-working-directory-pathname (directory-pathname pathname)
+ thunk)
+ (thunk))))))
(define (current-eval-unit #!optional error?)
(let ((unit *eval-unit*))
(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)
+(define (set-load-environment! environment)
+ (guarantee-environment environment 'SET-LOAD-ENVIRONMENT!)
(if (not (eq? *current-load-environment* 'NONE))
(begin
- (set! *current-load-environment* env)
+ (set! *current-load-environment* environment)
unspecific)))
+(define (with-load-environment environment thunk)
+ (guarantee-environment environment 'WITH-LOAD-ENVIRONMENT)
+ (fluid-let ((*current-load-environment* environment))
+ (thunk)))
+
(define (load/push-hook! hook)
(if (not load/loading?) (error condition-type:not-loading))
(set! load/after-load-hooks (cons hook load/after-load-hooks))
#| -*-Scheme-*-
-$Id: rep.scm,v 14.69 2007/10/12 01:08:02 cph Exp $
+$Id: rep.scm,v 14.70 2007/10/12 02:12:13 cph Exp $
Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
(define (ge environment)
(let ((environment (->environment environment 'GE)))
(set-repl/environment! (nearest-repl) environment)
- (set-current-load-environment! environment)
+ (set-load-environment! environment)
environment))
(define (->environment object #!optional caller)
#| -*-Scheme-*-
-$Id: runtime.pkg,v 14.628 2007/10/12 02:00:24 cph Exp $
+$Id: runtime.pkg,v 14.629 2007/10/12 02:12:14 cph Exp $
Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
load/push-hook!
load/suppress-loading-message?
set-command-line-parser!
+ set-load-environment!
simple-command-line-parser
system-library-uri
system-uri
- with-current-load-environment
with-eval-unit
+ with-load-environment
with-loader-base-uri)
- (export (runtime rep)
- set-current-load-environment!)
(initialization (initialize-package!)))
(define-package (runtime microcode-errors)