Last active
April 21, 2016 07:29
-
-
Save swr1bm86/04f4fef3b7a1260d9ee070fb569978c2 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
(defn Y [f] | |
((fn [x] (x x)) | |
(fn [x] | |
(f (fn [& args] | |
(apply (x x) args)))))) | |
(def fib | |
(fn [f] | |
(fn [n] | |
(condp = n | |
0 0 | |
1 1 | |
(+ (f (dec n)) | |
(f (dec (dec n)))))))) | |
((Y fib) 10) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment