Hacker News new | past | comments | ask | show | jobs | submit login

Not unless it's the loop is made out several function calls. For example:

    def even(x):
        return x == 0 ? True : odd(x - 1)

    def odd(x):
        return x == 0 ? False : even(x - 1)

    print(even(17))
Properly implemented TCO means that the call to 'even(17)' should use only one stack frame.



> Properly implemented TCO

Such is the case e.g. in Erlang/BEAM.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: