Skip to content

Instantly share code, notes, and snippets.

@plonk
Created July 21, 2013 16:46
Show Gist options
  • Select an option

  • Save plonk/6049109 to your computer and use it in GitHub Desktop.

Select an option

Save plonk/6049109 to your computer and use it in GitHub Desktop.
無名関数を再帰させる構造
p (fac = proc { |n| (n == 1) ? 1 : n * fac.call(n-1) }).call(5)
# OUTPUT: 120
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment