Skip to content

Instantly share code, notes, and snippets.

@swr1bm86
Last active April 21, 2016 07:29
Show Gist options
  • Save swr1bm86/04f4fef3b7a1260d9ee070fb569978c2 to your computer and use it in GitHub Desktop.
Save swr1bm86/04f4fef3b7a1260d9ee070fb569978c2 to your computer and use it in GitHub Desktop.
(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