2026-09-23 19:56 UTC
we can’t have TCO I guess so here’s a weird replacement
it works exactly like let but the extra NAME variable is the name of the function you call to do tail recursion
so for example, if you set NAME to recur then you have an exact copy of the clojure tail call feature, and using it won’t blow up your stack
I don’t hate this, I just wish it was documented anywhere
Replies (1)
-
@zzt@mas.to 2026-09-23 19:57
code for anyone having trouble picturing this (I guess I'm the documentation now): (named-let recur ((x 0) (l nil)) (if (< x 10) (recur (+ x 1) (push x l)) l))