Hi everyone.<br>Recently I read <a href="http://www.erlang.org/download/armstrong_thesis_2003.pdf">http://www.erlang.org/download/armstrong_thesis_2003.pdf</a>.<br> In this paper 3.3.8, the author talk about tail-recursive:<br>
"Firstly the non tail-recursive way:<br>factorial(0) -> 1;<br>factorial(N) -> N * factorial(N-1).<br>"<br>I see this section is non tail-recursive. In my mind, the tail-recursive is the better, because it do not consuming stack!<br>
<br>When I read OTP src, I find in the stdlib lists.erl. the map/2 write in this style:<br>"map(F, [H|T]) -><br> [F(H)|map(F, T)];<br>map(F, []) when is_function(F, 1) -> [].<br>"<br>I think it's non tail-recursive? realy? and why not ?<br>
tanks !<br><br clear="all"><br>