Created
August 23, 2012 22:53
-
-
Save shouya/3443025 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-macro my-let | |
(lambda (args . body) | |
(let ((names (map car args)) | |
(vals (map cadr args))) | |
(cons (cons 'lambda (cons names body)) vals)))) | |
(define-macro my-let-2 | |
(lambda (args . body) | |
(let ((names (map car args)) | |
(vals (map cadr args))) | |
`((lambda ,names ,@body) ,@vals)))) | |
(map | |
(lambda (func) (func ((a 1) | |
(b 2)) | |
(display (+ a b)) | |
(newline))) | |
(list my-let my-let-2)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment