brave-clojure-web icon indicating copy to clipboard operation
brave-clojure-web copied to clipboard

Chapter 5: Deep Mutual Recursion

Open weatherman2095pro opened this issue 8 years ago • 0 comments

In the chapter on Functional Programming, an example is made of mutually-recursive functions without a hard-set limit on recursion depth.

The example being a user-interactive game makes this reasonable. However, it may be interesting to mention to readers though that if one were to play again enough times (or have a script do it), because Clojure doesn't optimize away Mutual Tail Recursion, it will eventually blow the stack. Using the "trampoline" macro would prevent that.

weatherman2095pro avatar Oct 04 '17 02:10 weatherman2095pro