Skip to content

Instantly share code, notes, and snippets.

@stibear
Created December 15, 2013 14:04
Show Gist options
  • Save stibear/7973425 to your computer and use it in GitHub Desktop.
Save stibear/7973425 to your computer and use it in GitHub Desktop.
(define-syntax swap!
(ir-macro-transformer
(lambda (form inject compare?)
(let ((a (cadr form))
(b (caddr form)))
`(let ((tmp ,a))
(set! ,a ,b)
(set! ,b tmp))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment