Wrapping Up
In this chapter you’ve seen how Clojure’s support for functional programming strikes a well-motivated balance between academic purity and effectiveness on the Java Virtual Machine. Clojure provides a wide variety of techniques including self-recursion with recur, mutual recursion with trampoline, lazy sequences, and memoization.
Better still, for a wide variety of everyday programming tasks, you can use the sequence library without ever having to define your own explicit recursions of lazy sequences. Functions like partition create clean, expressive solutions that are much easier to write.
Finally, we saw how Clojure provides eager approaches as a companion to lazy sequences for use cases where eager evaluation is better suited. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access