Every single time there's a discussion about a new programming language targetting the JVM, there are inevitably people saying things like: "The JVM doesn't support tail-call optimization, so I ...
Ok, Python doesn't have tail call optimization. But for those who think better recursively than "looply", whats the best practices to write code?? 1000 stack calls are enough for many cases, but ...
We all know and love that function calls are usually implemented using the stack; there are frames, return addresses, parameters, the whole lot. However, the stack is an implementation detail: ...
Question What are the possible ways to solve a stack overflow caused by an recursive algorithm? Example I'm trying to solve Project Euler problem 14 and decided to try it with a recursive ...
The definition of a Y combinator in F# is let rec y f x = f (y f) x f expects to have as a first argument some continuation for the recursive subproblems. Using the y f as a continuation, we see ...
Clojure does not perform tail call optimization on its own: when you have a tail recursive function and you want to have it optimized, you have to use the special form recur. Similarly, if you have ...