<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-text-flowed" style="font-family: -moz-fixed;
font-size: 12px;" lang="x-unicode">Hello.
<br>
<br>
Erlang guarantees tail recursion optimization and states it in the
documentation:
<br>
<a class="moz-txt-link-freetext"
href="http://erlang.org/doc/reference_manual/functions.html#id78464">http://erlang.org/doc/reference_manual/functions.html#id78464</a>
<br>
<br>
Does erlang guarantee that tail call optimization is done in a
generic case, without recursion?
<br>
Say, we have a function calling a function from another module as
its final statement:
<br>
alpha() ->
<br>
xxx:beta().
<br>
Is it guaranteed that xxx:beta() will use the stack of alpha()
regardless whether recursion is involved.
<br>
I mean whether the language guarantees it rather than virtual
machine may provide such optimization.
<br>
<br>
Thanks in advance,
<br>
Salikhov Dinislam
<br>
</div>
</body>
</html>