Created
March 13, 2014 05:40
-
-
Save couchand/9522427 to your computer and use it in GitHub Desktop.
The Little CoffeeScripter
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
# the little coffeescripter | |
# http://weblog.bocoup.com/little-javascripter-revisited/ | |
Y = (le) -> | |
((f) -> f f) (f) -> | |
le (args...) -> | |
f(f) args... | |
factorial = | |
Y (f) -> | |
(n) -> | |
return 1 if n < 2 | |
n * f(n - 1) | |
console.log factorial 5 # 120 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment