6 ms·
Clojure has TCO, though. This is what recur is for.
by dragandj 10y ago
Clojure has TCO, though. This is what recur is for.
- willtim 10y agoNo Clojure does not have TCO, due to the JVM. It allows you to manually optimise self-recursion via recur. This is not enough for many advanced FP techniques, such as CPS. For example, using CPS and TCO, I can traverse a tree in constant stack space. I agree with the parent that lack of TCO in Clojure is probably not an issue for most.