Fluidize (runtime debugger) internals *dstate* and *port*.
authorMatt Birkholz <matt@birkholz.chandler.az.us>
Fri, 7 Feb 2014 17:55:36 +0000 (10:55 -0700)
committerMatt Birkholz <puck@birchwood-abbey.net>
Tue, 12 Aug 2014 00:30:29 +0000 (17:30 -0700)
src/runtime/debug.scm

index ec28896d3c3b8910548e3ceed1fe0bb8dcb0dde3..358698f5fee08edc6e78c67facd2c8f864aa820d 100644 (file)
@@ -162,6 +162,8 @@ USA.
   (stack-frame/reductions (dstate/subproblem dstate)))
 \f
 (define (initialize-package!)
+  (set! *dstate* (make-fluid 'UNBOUND))
+  (set! *port* (make-fluid 'UNBOUND))
   (set!
    command-set
    (make-command-set
@@ -232,8 +234,10 @@ USA.
         (let ((dstate (cadr (cadr form)))
               (port (caddr (cadr form))))
           `(DEFINE (,(car (cadr form)) #!OPTIONAL ,dstate ,port)
-             (LET ((,dstate (IF (DEFAULT-OBJECT? ,dstate) *DSTATE* ,dstate))
-                   (,port (IF (DEFAULT-OBJECT? ,port) *PORT* ,port)))
+             (LET ((,dstate (IF (DEFAULT-OBJECT? ,dstate)
+                                (FLUID *DSTATE*)
+                                ,dstate))
+                   (,port (IF (DEFAULT-OBJECT? ,port) (FLUID *PORT*) ,port)))
                ,@(map (let ((free (list dstate port)))
                         (lambda (expression)
                           (make-syntactic-closure environment free
@@ -806,11 +810,12 @@ USA.
 (define *port*)
 
 (define (command/internal dstate port)
-  (fluid-let ((*dstate* dstate)
-             (*port* port))
-    (debug/read-eval-print (->environment '(RUNTIME DEBUGGER))
-                          "the debugger"
-                          "the debugger environment")))
+  (let-fluids *dstate* dstate
+             *port* port
+    (lambda ()
+      (debug/read-eval-print (->environment '(RUNTIME DEBUGGER))
+                            "the debugger"
+                            "the debugger environment"))))
 
 (define-command (command/frame dstate port)
   (debugger-presentation port