From: Matt Birkholz Date: Tue, 4 Feb 2014 22:10:59 +0000 (-0700) Subject: Fluidize (runtime unsyntaxer) internal variable: substitutions. X-Git-Tag: mit-scheme-pucked-9.2.12~401^2~16 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=031ab86e0697769a321c6e10bc697b8486834225;p=mit-scheme.git Fluidize (runtime unsyntaxer) internal variable: substitutions. --- diff --git a/src/runtime/unsyn.scm b/src/runtime/unsyn.scm index 0ba5ba7d6..42e7887d3 100644 --- a/src/runtime/unsyn.scm +++ b/src/runtime/unsyn.scm @@ -30,6 +30,7 @@ USA. (declare (usual-integrations)) (define (initialize-package!) + (set! substitutions (make-fluid '())) (set! unsyntaxer/scode-walker (make-scode-walker unsyntax-constant `((ACCESS ,unsyntax-ACCESS-object) @@ -63,13 +64,14 @@ USA. ;;; The substitutions mechanism is for putting the '### marker in ;;; debugger output. -(define substitutions '()) +(define substitutions) (define (unsyntax-with-substitutions scode alist) (if (not (alist? alist)) (error:wrong-type-argument alist "alist" 'UNSYNTAX-WITH-SUBSTITUTIONS)) - (fluid-let ((substitutions alist)) - (unsyntax scode))) + (let-fluid substitutions alist + (lambda () + (unsyntax scode)))) (define-integrable (maybe-substitute object thunk) (let ((association (has-substitution? object))) @@ -78,8 +80,8 @@ USA. (thunk)))) (define-integrable (has-substitution? object) - (and (pair? substitutions) - (assq object substitutions))) + (let ((substs (fluid substitutions))) + (and (pair? substs) (assq object substs)))) (define (with-bindings environment lambda receiver) (if (and unsyntaxer:elide-global-accesses?