4 ms·
Have you considered using a "trampoline" function like this? http://paulbutler.org/archives/tail-recursion-in-python/ http://paulbutler.org/archives/tail-recur
by julian37 16y ago
Have you considered using a "trampoline" function like this?
http://paulbutler.org/archives/tail-recursion-in-python/ http://paulbutler.org/archives/tail-recursion-in-python/
- metageek 16y agoInteresting...no, I hadn't seen that before. I'll think about it.
- silentbicycle 16y agoYou'll get a lot out of _Lisp in Small Pieces_ (http://pagesperso-systeme.lip6.fr/Christian.Queinnec/WWW/LiSP.html http://pagesperso-systeme.lip6.fr/Christian.Queinnec/WWW/LiS...), as well. Python wouldn't be my first choice, and I'm unconvinced that Lisp-Py makes sense, but I'm sure you'll find ways to adapt it regardless.