(no title)
skrishnamurthi | 5 months ago
Moreover, you can design cooperating macros that induce and take advantage of tail-position calls.
Here's a simple example that motivates tail-calls that are not tail-recursive:
https://cs.brown.edu/~sk/Publications/Papers/Published/sk-au...
adityaathalye|5 months ago
recur: https://clojuredocs.org/clojure.core/recur
the recursion point to the values of the exprs. trampoline: https://clojuredocs.org/clojure.core/trampoline i.e. these emulate TCO, with similar stack consumption properties (they don't implement real TCO).(edit: formatting)
skrishnamurthi|5 months ago
https://dl.acm.org/doi/pdf/10.1145/317636.317779
Usually the trampoline is implemented automatically by the language rather than forcing the author to confront it, though I can see why Clojure might have chosen to put the burden on the user.