Skip to content

Instantly share code, notes, and snippets.

@monmon
Created March 17, 2014 11:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save monmon/9597623 to your computer and use it in GitHub Desktop.
Save monmon/9597623 to your computer and use it in GitHub Desktop.
sicpの問題4.21が一瞬読めなかったのでJavaScriptで書く
(function (n) {
return (function (fact) {
return fact(fact, n);
})(function (ft, k) {
return (k === 1) ? 1
: k * (ft(ft, (k - 1)));
});
})(10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment