How to avoid stack overflow

Started by ssqq, August 01, 2016, 01:08:52 AM

Previous topic - Next topic

ssqq

I don't know how resume stack space in newLISP.



If I use one function do too much thiings, then the stack of function may occur stack overflow?



If i reject the return value when call other function, then would avoid stack overflow?



If anyone could give me some advise?

rickyboy

#1
Quote from: "ssqq"I don't know how resume stack space in newLISP.



If I use one function do too much thiings, then the stack of function may occur stack overflow?



If i reject the return value when call other function, then would avoid stack overflow?



If anyone could give me some advise?

I don't understand what you are trying to do.  Could you give an example (code) to clarify?



(The only guess I can venture is that you are doing recursive calls and blowing up the stack and you may be asking if newLISP has tail call optimization. It doesn't.  All recursive calls add to the stack and there is no way of avoiding that in newLISP, as far as I know.)
(λx. x x) (λx. x x)