4 ms·
How does Hy manage recursion given the limitations there in Python?
by alexanderdmitri 7y ago
How does Hy manage recursion given the limitations there in Python?
- gilch 7y agoIt doesn't. Or does the same way as Python: imperative loops. TCO is a key feature of Scheme, but not of Lisps in general. Clojure doesn't have it. You can always trampoline like Clojure's loop does.
- alexanderdmitri 7y ago10-4, thank you!
- jedimastert 7y agoWhat kind of limitations are you referring to?
- alexanderdmitri 7y agoPython limits the stack to a 1000 and a series of recursive calls hitting that ceiling will throw a `RecursionError`.
- gilch 7y agoYou can actually set this to a higher number in the sys module. Maybe not too high if you don't like segfaults.