Skip to content

Instantly share code, notes, and snippets.

@n8agrin
Created June 13, 2009 15:29
Show Gist options
  • Save n8agrin/129285 to your computer and use it in GitHub Desktop.
Save n8agrin/129285 to your computer and use it in GitHub Desktop.
Erlang tail recursion example
len([]) ->
0;
len([F|R]) ->
len(R,1).
len([],A) ->
A;
len([F|R],A) ->
len(R, A+1).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment