Page 1 of 1
tail recursion
Posted: Sun Oct 16, 2005 8:46 pm
by Dmi
Does newLisp have a "tail recursion" optimization?
Just a question.
Posted: Sun Oct 16, 2005 9:00 pm
by Lutz
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
Posted: Sun Oct 16, 2005 9:06 pm
by Dmi
Thanks!