4 ms·
Thanks for teaching me about the fn trampoline, which I had never seen/used before! Really cool project!
by Heliosmaster 7y ago
Thanks for teaching me about the fn trampoline, which I had never seen/used before!
Really cool project!
- netb258 7y agoYeah trampoline is kind of rare. You only see it in cases where some functions are mutually recursive.
- thom 7y agoIt's very useful. I once had a codebase where we wrote two (parallel) variants of trampoline called tramampoline and trambopoline, and I'm not even a little bit sorry.
- nick0garvey 7y agoI'm looking at the source, but I'm not sure why "without stack consumption" is true. Is this because trampoline is written such that it takes advantage of tail call optimization even if the inner function doesn't? https://github.com/clojure/clojure/blob/clojure-1.9.0/src/clj/clojure/core.clj#L6219 https://github.com/clojure/clojure/blob/clojure-1.9.0/src/cl...