Skip to content

Instantly share code, notes, and snippets.

@tfnico
Created May 31, 2011 13:28
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 tfnico/1000498 to your computer and use it in GitHub Desktop.
Save tfnico/1000498 to your computer and use it in GitHub Desktop.
Weel examples
// Note the tail call optimization!
private func fact_f(n, result)
return n > 0 ? fact_f(n - 1, result * n) : result;
end
func fact(n)
return fact_f(n, 1);
end
// fact(140): 8.791460022621322E - 4 seconds
@tfnico
Copy link
Author

tfnico commented May 31, 2011

For more goodness, see https://github.com/rjeschke/weel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment