tail recursion

Started by Dmi, October 16, 2005, 01:46:01 PM

Previous topic - Next topic

Dmi

Does newLisp have a "tail recursion" optimization?

Just a question.
WBR, Dmi

Lutz

#1
No tail recursion optimization, but the possibility to adjust the maximum stack size at startup. By default the max stack is set to 1024. There is no problem to adjust e.g. to 100,000. You need about 80 bytes overhead per stack position. In practice you will find out that this is rarely necessary. Normally when tail-recursion is possible (the recursive function call is the last call), an iterative solution is easily visible as well.



Lutz

Dmi

#2
Thanks!
WBR, Dmi