Fix parameterization in rep.scm.
authorChris Hanson <org/chris-hanson/cph>
Sun, 28 Feb 2016 03:35:41 +0000 (19:35 -0800)
committerChris Hanson <org/chris-hanson/cph>
Sun, 28 Feb 2016 03:35:41 +0000 (19:35 -0800)
src/runtime/rep.scm
src/runtime/runtime.pkg

index 315dc5106c90e3e9fc5d5d0a3a7d93af8faa8133..e7a1d47b246bb7a2f1e0f635ff0b4a0e4ae7314a 100644 (file)
@@ -33,15 +33,13 @@ USA.
 (define repl:write-result-hash-numbers? #t)
 
 (define (initialize-package!)
-  (set! *nearest-cmdl* (make-parameter #f))
-  (set! standard-breakpoint-hook (make-parameter #f))
+  (set! param:nearest-cmdl (make-unsettable-parameter #f))
   (set! hook/repl-read default/repl-read)
   (set! hook/repl-eval default/repl-eval)
   (set! hook/repl-write default/repl-write)
   (set! hook/set-default-environment default/set-default-environment)
   (set! hook/error-decision #f)
-  (initialize-breakpoint-condition!)
-  unspecific)
+  (initialize-breakpoint-condition!))
 
 (define (initial-top-level-repl)
   (call-with-current-continuation
@@ -124,10 +122,10 @@ USA.
                    (cons *interaction-i/o-port* #f)
                    (cons working-directory-pathname
                          (working-directory-pathname))
-                   (cons *nearest-cmdl* cmdl)
+                   (cons param:nearest-cmdl cmdl)
                    (cons standard-error-hook #f)
                    (cons standard-warning-hook #f)
-                   (cons standard-breakpoint-hook #f)
+                   (cons param:standard-breakpoint-hook #f)
                    (cons param:default-pathname-defaults
                          (param:default-pathname-defaults))
                    (cons dynamic-handler-frames '())
@@ -201,27 +199,27 @@ USA.
 (define (cmdl-abort-restart? restart)
   (restart/get restart cmdl-abort-restart-tag))
 
-(define *nearest-cmdl*)
+(define param:nearest-cmdl)
 
 (define (nearest-cmdl)
-  (let ((cmdl (*nearest-cmdl*)))
+  (let ((cmdl (param:nearest-cmdl)))
     (if (not cmdl) (error "NEAREST-CMDL: no cmdl"))
     cmdl))
 
 (define (nearest-cmdl/port)
-  (let ((cmdl (*nearest-cmdl*)))
+  (let ((cmdl (param:nearest-cmdl)))
     (if cmdl
        (cmdl/port cmdl)
        console-i/o-port)))
 
 (define (nearest-cmdl/level)
-  (let ((cmdl (*nearest-cmdl*)))
+  (let ((cmdl (param:nearest-cmdl)))
     (if cmdl
        (cmdl/level cmdl)
        0)))
 
 (define (nearest-cmdl/batch-mode?)
-  (let ((cmdl (*nearest-cmdl*)))
+  (let ((cmdl (param:nearest-cmdl)))
     (if cmdl
        (cmdl/batch-mode? cmdl)
        #f)))
@@ -916,6 +914,8 @@ USA.
 (define breakpoint/message)
 (define breakpoint/prompt)
 (define %signal-breakpoint)
+(define param:standard-breakpoint-hook)
+(define standard-breakpoint-hook #!default)
 
 (define (initialize-breakpoint-condition!)
   (set! condition-type:breakpoint
@@ -944,18 +944,21 @@ USA.
                                   prompt)))
              (signal-condition condition)
              (standard-breakpoint-handler condition)))))
+  (set! param:standard-breakpoint-hook (make-settable-parameter #f))
   unspecific)
 
 (define (standard-breakpoint-handler condition)
-  (let ((hook (standard-breakpoint-hook)))
+  (let ((hook
+        (if (default-object? standard-breakpoint-hook)
+            (param:standard-breakpoint-hook)
+            standard-breakpoint-hook)))
     (if hook
-       (parameterize* (list (cons standard-breakpoint-hook #f))
-         (lambda ()
-           (hook condition)))))
+       (fluid-let ((standard-breakpoint-hook #!default))
+         (parameterize* (list (cons param:standard-breakpoint-hook #f))
+           (lambda ()
+             (hook condition))))))
   (repl/start (push-repl (breakpoint/environment condition)
                         condition
                         '()
                         (breakpoint/prompt condition))
-             (breakpoint/message condition)))
-
-(define standard-breakpoint-hook)
+             (breakpoint/message condition)))
\ No newline at end of file
index 450c38ac72b98eadd558a7be61d96fcead09f94a..b049f6aea102e6ff79d539e9b6cc6b4b6d0f3dab 100644 (file)
@@ -3589,6 +3589,7 @@ USA.
          nearest-repl/condition
          nearest-repl/environment
          out
+         param:standard-breakpoint-hook
          pe
          proceed
          push-cmdl