[functional-tests] fluid-let is already in (chezscheme)

This commit is contained in:
Joe Thornber 2017-08-24 14:09:23 +01:00
parent 02618e39d1
commit 0740cb7bcc

View File

@ -2,8 +2,7 @@
(utils) (utils)
(export inc! (export inc!
dec! dec!
swap! swap!)
fluid-let)
(import (rnrs)) (import (rnrs))
(define-syntax inc! (define-syntax inc!
@ -22,16 +21,4 @@
(let ((tmp x)) (let ((tmp x))
(set! x y) (set! x y)
(set! y tmp))))) (set! y tmp)))))
(define-syntax fluid-let
(syntax-rules ()
((_ ((x e)) b1 b2 ...)
(let ((y e))
(let ((swap (lambda ()
(let ((t x))
(set! x y)
(set! y t)))))
(dynamic-wind swap (lambda ()
b1 b2 ...)
swap))))))
) )