Created
March 14, 2013 03:55
-
-
Save ayato-p/5158698 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 Y | |
(lambda (f) | |
((lambda (x) (x x)) | |
(lambda (x) | |
(f (lambda (y) ((x x) y))))))) | |
(define add | |
(Y (lambda (add) | |
(lambda (tup) | |
(cond | |
((zero? (car (cdr tup))) (car tup)) | |
(else (add (cons (+ (car tup) 1) | |
(cons | |
(- (car (cdr tup)) 1) '()))))))))) | |
(add '(10 20)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment