3 ms·
Recursion is looping. Some iterative loops can be expressed recursively - these are the ones that can be tail call optimized. SICP has a good explanation: http
by brudgers 12y ago
Recursion is looping. Some iterative loops can be expressed recursively - these are the ones that can be tail call optimized. SICP has a good explanation:
https://mitpress.mit.edu/sicp/full-text/sicp/book/node15.html https://mitpress.mit.edu/sicp/full-text/sicp/book/node15.htm...
The advantage of using recursive definitions for loops is that it avoids modifying places in favor of returning values. Rich Hickey gives a good talk on the subject in The Value of Values:
http://www.infoq.com/presentations/Value-Values http://www.infoq.com/presentations/Value-Values