Last active
December 11, 2015 09:23
-
-
Save roobie/4dbd0090d35bc817f273 to your computer and use it in GitHub Desktop.
reverse, tail call optimised.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -module(recursive). | |
| reverse(L) -> | |
| reverse_tco([], L). | |
| reverse_tco(Acc, []) -> | |
| Acc; | |
| reverse_tco(Acc, [Head|Tail]) -> | |
| reverse_tco([Head|Acc], Tail). | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment