Skip to content

Instantly share code, notes, and snippets.

@arsane
Last active August 10, 2016 02:33
Show Gist options
  • Save arsane/d13854080a6104bcb932222c7f7f4e09 to your computer and use it in GitHub Desktop.
Save arsane/d13854080a6104bcb932222c7f7f4e09 to your computer and use it in GitHub Desktop.
# lambda recusion.
puts ->() {
error = ->(n) {throw "SHOULD NEVER BE CALLED"}
->(g) {
g.(g)
}.(
->(f) {
->(n) {n.zero? ? 1 : n * f.(f).(n-1)}
}
).(500)
}.()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment