Fix recent change to SHALLOW-FLUID-BIND.
authorTaylor R Campbell <campbell@mumble.net>
Thu, 7 Oct 2010 05:47:30 +0000 (05:47 +0000)
committerTaylor R Campbell <campbell@mumble.net>
Thu, 7 Oct 2010 05:47:30 +0000 (05:47 +0000)
This works around lossage with unassigned variables:

   (define x)
   (fluid-let ((x 0)) ...)
   ;Unassigned variable: x

This relies on the deprecated semantics of SET! that returns the
variable's old value (or old reference trap, if unassigned).

src/runtime/mit-macros.scm

index c181de728c364a4130f9c471eaac1f938a920b39..bbfe5acb3738a0d8e5aebed5c38fa56a49668240 100644 (file)
@@ -542,10 +542,7 @@ USA.
         `(,r-let ,(map list temporaries expressions)
            (,r-define (,swap!)
              ,@(map (lambda (name temporary)
-                      (let ((temporary* (make-synthetic-identifier 'TEMP)))
-                        `(,r-let ((,temporary* ,temporary))
-                           (,r-set! ,temporary ,name)
-                           (,r-set! ,name ,temporary*))))
+                      `(,r-set! ,name (,r-set! ,temporary (,r-set! ,name))))
                     names
                     temporaries)
              ,r-unspecific)