12 ms·
I mean, if I were doing an ordinary non-recursive function call that just happened to be in tail position, and it got eliminated, and this caused me to not be a
by ameliaquining 2y ago
I mean, if I were doing an ordinary non-recursive function call that just happened to be in tail position, and it got eliminated, and this caused me to not be able to get the full stack trace while debugging, I might be annoyed.
In a couple languages I've seen proposals to solve this problem with a syntactic opt-in for tail call elimination, though I'm not sure whether any mainstream language has actually implemented this.
- chowells 2y agoLanguage designers could keep taking ideas from Haskell, and allow functions to opt in to appearing in stack traces. Give the programmer control, and all.
- SamLL 2y agoKotlin has a syntactic opt-in for tail call elimination (the "tailrec" modifier).
- michaelmrose 2y agohttps://clojuredocs.org/clojure.core/recur https://clojuredocs.org/clojure.core/recur