From: Matt Birkholz Date: Sat, 1 Feb 2014 05:37:43 +0000 (-0700) Subject: Fluidize *nearest-cmdl*. X-Git-Tag: mit-scheme-pucked-9.2.12~401^2~30 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=ad10e31cef51b60bd5a6fecd72ded2a8cb6a0080;p=mit-scheme.git Fluidize *nearest-cmdl*. --- diff --git a/src/runtime/rep.scm b/src/runtime/rep.scm index c91e1704d..a91d12019 100644 --- a/src/runtime/rep.scm +++ b/src/runtime/rep.scm @@ -33,7 +33,7 @@ USA. (define repl:write-result-hash-numbers? #t) (define (initialize-package!) - (set! *nearest-cmdl* #f) + (set! *nearest-cmdl* (make-fluid #f)) (set! hook/repl-read default/repl-read) (set! hook/repl-eval default/repl-eval) (set! hook/repl-write default/repl-write) @@ -122,9 +122,9 @@ USA. *trace-output-port* #f *interaction-i/o-port* #f *working-directory-pathname* (fluid *working-directory-pathname*) + *nearest-cmdl* cmdl (lambda () - (fluid-let ((*nearest-cmdl* cmdl) - (dynamic-handler-frames '()) + (fluid-let ((dynamic-handler-frames '()) (*bound-restarts* (if (cmdl/parent cmdl) *bound-restarts* '())) (standard-error-hook #f) @@ -202,23 +202,24 @@ USA. (define *nearest-cmdl*) (define (nearest-cmdl) - (if (not *nearest-cmdl*) (error "NEAREST-CMDL: no cmdl")) - *nearest-cmdl*) + (let ((cmdl (fluid *nearest-cmdl*))) + (if (not cmdl) (error "NEAREST-CMDL: no cmdl")) + cmdl)) (define (nearest-cmdl/port) - (let ((cmdl *nearest-cmdl*)) + (let ((cmdl (fluid *nearest-cmdl*))) (if cmdl (cmdl/port cmdl) console-i/o-port))) (define (nearest-cmdl/level) - (let ((cmdl *nearest-cmdl*)) + (let ((cmdl (fluid *nearest-cmdl*))) (if cmdl (cmdl/level cmdl) 0))) (define (nearest-cmdl/batch-mode?) - (let ((cmdl *nearest-cmdl*)) + (let ((cmdl (fluid *nearest-cmdl*))) (if cmdl (cmdl/batch-mode? cmdl) #f)))