Skip to content

Instantly share code, notes, and snippets.

@fanweixiao
Created May 14, 2012 10:15
Show Gist options
  • Save fanweixiao/2693106 to your computer and use it in GitHub Desktop.
Save fanweixiao/2693106 to your computer and use it in GitHub Desktop.
tail recursion fibonacci in coffee
fib = (n)->
return ((n,a,b) ->
if n>0 then arguments.callee n-1, b, a+b else a
)(n,0,1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment