From d8989c2ae3d685b15c16491e30ae8d40580ed059 Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Tue, 16 Jul 2013 01:30:51 -0400 Subject: Improve macro definition. It's more robust to use `let' to have the macro result in its own new scope. (Unrelated to the hygiene point, of course.) --- racket.html.markdown | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'racket.html.markdown') diff --git a/racket.html.markdown b/racket.html.markdown index e528bc74..526d008c 100644 --- a/racket.html.markdown +++ b/racket.html.markdown @@ -423,8 +423,7 @@ vec ; => #(1 2 3 4) ;; Macros are hygienic, you cannot clobber existing variables! (define-syntax-rule (swap x y) - (begin - (define tmp x) + (let ([tmp x]) (set! x y) (set! y tmp))) -- cgit v1.2.3