From 20e6e0b95b70be19d7fbe782d3038df6f0ad8ac4 Mon Sep 17 00:00:00 2001 From: Matt Birkholz Date: Fri, 7 Feb 2014 10:55:36 -0700 Subject: [PATCH] Fluidize (runtime debugger) internals *dstate* and *port*. --- src/runtime/debug.scm | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/runtime/debug.scm b/src/runtime/debug.scm index ec28896d3..358698f5f 100644 --- a/src/runtime/debug.scm +++ b/src/runtime/debug.scm @@ -162,6 +162,8 @@ USA. (stack-frame/reductions (dstate/subproblem dstate))) (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 -- 2.25.1