Created
December 15, 2013 13:14
-
-
Save stibear/7972935 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define-syntax swap! | |
(sc-macro-transformer | |
(lambda (form env) | |
(let ((a (make-syntactic-closure env '() (cadr form))) | |
(b (make-syntactic-closure env '() (caddr form)))) | |
`(let ((value ,a)) | |
(set! ,a ,b) | |
(set! ,b value)))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment