Skip to content

Instantly share code, notes, and snippets.

@ecounysis
Created March 27, 2010 01:34
Show Gist options
  • Save ecounysis/345615 to your computer and use it in GitHub Desktop.
Save ecounysis/345615 to your computer and use it in GitHub Desktop.
(define-syntax let2
(syntax-rules ()
[(_ ((var val) ...) (exp ...))
((lambda (var ...) (exp ...)) val ...)]))
(define-syntax let2*
(syntax-rules ()
[(_ ([x1 v1]) e ...) (let2 ([x1 v1]) e ...)]
[(_ [(x1 v1) (x2 v2)] (e ...))
[let2* ((x1 v1)) (let2* ((x2 v2)) (e ...))]]
[(_ [(x1 v1) (x2 v2) ...] (e ...))
[let2* ((x1 v1)) (let2* ((x2 v2) ...) (e ...))]]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment