2 ms·
This is what Rich said about TCO in Clojure in 2010: ```quote: When speaking about general TCO, we are not just talking about recursive self-calls, but also t
by iLemming 6y ago
This is what Rich said about TCO in Clojure in 2010:
```quote:
When speaking about general TCO, we are not just talking about
recursive self-calls, but also tail calls to other functions. Full TCO
in the latter case is not possible on the JVM at present whilst
preserving Java calling conventions (i.e without interpreting or
inserting a trampoline etc).
While making self tail-calls into jumps would be easy (after all,
that's what recur does), doing so implicitly would create the wrong
expectations for those coming from, e.g. Scheme, which has full TCO.
So, instead we have an explicit recur construct.
Essentially it boils down to the difference between a mere
optimization and a semantic promise. Until I can make it a promise,
I'd rather not have partial TCO.
Some people even prefer 'recur' to the redundant restatement of the
function name. In addition, recur can enforce tail-call position.
```endquote
https://groups.google.com/g/clojure/c/4bSdsbperNE/m/tXdcmbiv4g0J https://groups.google.com/g/clojure/c/4bSdsbperNE/m/tXdcmbiv...