[erlang-questions] Would this function be tail-recursive?

Masklinn <>
Mon Jun 10 14:23:53 CEST 2013


On 2013-06-10, at 14:08 , Yves S. Garret wrote:

> Hi all, it's been some time since I've touched Erlang.  I found this code
> and would
> like to know if it would be tail-recursive:
> http://bin.cakephp.org/view/2084302499
> 
> Would loop need to be called at the end of the method or is it fine if it's
> called just before end?

This function is tail-recursive yes: there's nothing to evaluate after
the recursive `loop` call so it's in "tail" position.




More information about the erlang-questions mailing list