and load/suppress-loading-message?. Punted old load-noisily?.
Components of Pathnames, scheme, MIT/GNU Scheme Reference Manual}.)
@end deffn
-@defvr variable load-noisily?
-If @code{load-noisily?} is set to @code{#t}, @code{load} will print the
-value of each expression in the file as it is evaluated. Otherwise,
-nothing is printed except for the value of the last expression in the
-file. (Note: the noisy loading feature is implemented for source-code
-files only.)
-@end defvr
-
@cindex working directory
@findex pwd
@findex cd
(groups/files-to-copy groups)))))
(define (load-quietly pathname environment)
- (fluid-let ((load/suppress-loading-message? #t))
- (load pathname environment)))
+ (let-fluid load/suppress-loading-message? #t
+ (lambda ()
+ (load pathname environment))))
(define (->string object)
(if (string? object)
(bind-condition-handler (list condition-type:error)
evaluation-error-handler
(lambda ()
- (fluid-let ((load/suppress-loading-message? #t))
- ((message-wrapper #f "Loading " (car library))
- (lambda ()
- (load-library library))))))))
+ (let-fluid load/suppress-loading-message? #t
+ (lambda ()
+ ((message-wrapper #f "Loading " (car library))
+ (lambda ()
+ (load-library library)))))))))
(load-library library))))))
(cond ((not (library-loaded? name))
(do-it))
(bind-condition-handler (list condition-type:error)
evaluation-error-handler
(lambda ()
- (fluid-let ((load/suppress-loading-message? #t))
- (load filename environment 'DEFAULT purify?)))))))
\ No newline at end of file
+ (let-fluid load/suppress-loading-message? #t
+ (lambda ()
+ (load filename environment 'DEFAULT purify?))))))))
\ No newline at end of file
(lambda ()
(catch-file-errors (lambda (condition) condition #f)
(lambda ()
- (fluid-let ((load/suppress-loading-message? #t))
- (load pathname '(EDWIN)))))))))))
+ (let-fluid load/suppress-loading-message? #t
+ (lambda ()
+ (load pathname '(EDWIN))))))))))))
(if (and (procedure? database)
(procedure-arity-valid? database 1))
(database buffer)
(->namestring (system-library-directory-pathname)))
(define (shim-conf)
- (fluid-let ((load/suppress-loading-message? #t))
- (load (system-library-pathname "shim-config.scm"))))
+ (let-fluid load/suppress-loading-message? #t
+ (lambda ()
+ (load (system-library-pathname "shim-config.scm")))))
(define (doc-conf)
- (fluid-let ((load/suppress-loading-message? #t))
- (load (string-append (conf-value (shim-conf) 'INFODIR)
- "mit-scheme-doc-config.scm"))))
+ (let-fluid load/suppress-loading-message? #t
+ (lambda ()
+ (load (string-append (conf-value (shim-conf) 'INFODIR)
+ "mit-scheme-doc-config.scm")))))
(define (conf-values conf name)
(let ((entry (assq name conf)))
;; Toplevel entry point for the generator.
;; Returns a new C-INCLUDES structure.
(let ((includes (make-c-includes library))
- (cwd (if load/loading?
+ (cwd (if (fluid load/loading?)
(directory-pathname (current-load-pathname))
(working-directory-pathname))))
(fluid-let ((c-include-noisily? #t))
(define (load-ffi-quietly)
(if (not (name->package '(FFI)))
(let ((kernel (lambda ()
- (fluid-let ((load/suppress-loading-message? #t))
- (load-option 'FFI)))))
+ (let-fluid load/suppress-loading-message? #t
+ (lambda ()
+ (load-option 'FFI))))))
(if (nearest-cmdl/batch-mode?)
(kernel)
(with-notification (lambda (port)
(set! condition-type:not-loading
(make-condition-type 'NOT-LOADING condition-type:error '()
"No file being loaded."))
+ (set! load/loading? (make-fluid #f))
+ (set! load/suppress-loading-message? (make-fluid #f))
(set! load/after-load-hooks (make-fluid '()))
(set! *eval-unit* (make-fluid #f))
(set! *current-load-environment* (make-fluid 'NONE))
(define load/loading?)
(define load/after-load-hooks)
-(define load/suppress-loading-message? #f)
+(define load/suppress-loading-message?)
(define *eval-unit*)
(define *current-load-environment*)
(define *write-notifications?*)
(define *purification-root-marker*)
(define condition-type:not-loading)
-
-;; Obsolete and ignored:
-(define load-noisily? #f)
\f
(define (load pathname #!optional environment syntax-table purify?)
syntax-table ;ignored
(define (load-1 pathname environment purify?)
(receive (pathname* loader notifier) (choose-load-method pathname)
(if pathname*
- (maybe-notify load/suppress-loading-message?
+ (maybe-notify (fluid load/suppress-loading-message?)
(loader environment purify?)
notifier)
(load-failure load-1 pathname environment purify?))))
(define (maybe-notify suppress-notifications? loader notifier)
(let ((notify?
(if (if (default-object? suppress-notifications?)
- load/suppress-loading-message?
+ (fluid load/suppress-loading-message?)
suppress-notifications?)
#f
(fluid *write-notifications?*))))
thunk))
(define (load/push-hook! hook)
- (if (not load/loading?) (error condition-type:not-loading))
+ (if (not (fluid load/loading?)) (error condition-type:not-loading))
(set-fluid! load/after-load-hooks (cons hook (fluid load/after-load-hooks)))
unspecific)
(define (handle-load-hooks thunk)
(receive (result hooks)
- (fluid-let ((load/loading? #t))
- (let-fluid load/after-load-hooks '()
- (lambda ()
- (let ((result (thunk)))
- (values result (reverse (fluid load/after-load-hooks)))))))
+ (let-fluids load/loading? #t
+ load/after-load-hooks '()
+ (lambda ()
+ (let ((result (thunk)))
+ (values result (reverse (fluid load/after-load-hooks))))))
(for-each (lambda (hook) (hook)) hooks)
result))
(lambda (arg)
(run-in-nearest-repl
(lambda (repl)
- (fluid-let ((load/suppress-loading-message? (cmdl/batch-mode? repl)))
- (load arg (repl/environment repl))))))
+ (let-fluid load/suppress-loading-message? (cmdl/batch-mode? repl)
+ (lambda ()
+ (load arg (repl/environment repl)))))))
"Loads the argument files as if in the REPL."
"In batch mode, loading messages are suppressed.")
(argument-command-line-parser "eval" #t
(lambda ()
(fluid-let ((*options* '())
(*parent* #f))
- (fluid-let ((load/suppress-loading-message? #t))
- (load pathname (make-load-environment)))
+ (let-fluid load/suppress-loading-message? #t
+ (lambda ()
+ (load pathname (make-load-environment))))
(values *options* *parent*)))
find-option))
file-loadable?
load
load-library-object-file
- load-noisily?
load/loading?
load/purification-root
load/push-hook!
environment))
(define ((pi-expander environment) text)
- (fluid-let ((*outputs* (cons '() '()))
- (load/suppress-loading-message? #t))
- (let ((port (open-input-string text)))
- (let loop ()
- (let ((expression (read port)))
- (if (not (eof-object? expression))
- (begin
- (expander-eval expression environment)
- (loop))))))
+ (fluid-let ((*outputs* (cons '() '())))
+ (let-fluid load/suppress-loading-message? #t
+ (lambda ()
+ (let ((port (open-input-string text)))
+ (let loop ()
+ (let ((expression (read port)))
+ (if (not (eof-object? expression))
+ (begin
+ (expander-eval expression environment)
+ (loop))))))))
(car *outputs*)))
(define expander-eval eval)
(environment-define environment 'define-xmlrpc-method
(lambda (name handler)
(hash-table/put! methods name handler)))
- (fluid-let ((load/suppress-loading-message? #t))
- (load pathname environment)))
+ (let-fluid load/suppress-loading-message? #t
+ (lambda ()
+ (load pathname environment))))
(hash-table/get methods name #f)))
\ No newline at end of file
(notification-output-port))
(error "Test FFI build failed:" status))
(begin
- (fluid-let ((load/suppress-loading-message? #t))
- (load-option 'FFI))
+ (let-fluid load/suppress-loading-message? #t
+ (lambda ()
+ (load-option 'FFI)))
(with-system-library-directories '("./")
(lambda ()
(compile-file "test-ffi-wrapper")))