Created
August 16, 2017 00:08
-
-
Save Sophia-Gold/15c0415ca0a0ae671dd09f0bebbb3f2a 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 fac | |
| (fn [f] | |
| (fn [n] | |
| (if (zero? n) 1 (* n (f (dec n))))))) | |
| (def fib | |
| (fn [f] | |
| (fn [n] | |
| (condp = n | |
| 0 0 | |
| 1 1 | |
| (+ (f (dec n)) | |
| (f (dec (dec n)))))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment