Skip to content

Instantly share code, notes, and snippets.

@stibear
Created December 15, 2013 13:14
Show Gist options
  • Save stibear/7972935 to your computer and use it in GitHub Desktop.
Save stibear/7972935 to your computer and use it in GitHub Desktop.
(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