newLISP Fan Club

Forum => Anything else we might add? => Topic started by: Dmi on October 16, 2005, 01:46:01 PM

Title: tail recursion
Post by: Dmi on October 16, 2005, 01:46:01 PM
Does newLisp have a "tail recursion" optimization?

Just a question.
Title:
Post by: Lutz on October 16, 2005, 02:00:30 PM
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
Title:
Post by: Dmi on October 16, 2005, 02:06:07 PM
Thanks!