Chapter 4
Functional Programming

Functional programming (FP) is a big topic, not to be learned in 21 days[21] or in a single chapter of a book. Nevertheless, you can reach a first level of effectiveness using lazy and recursive techniques in Clojure fairly quickly, and that is what we’ll accomplish this chapter.

We’ll start with a quick overview of FP terms and concepts and an introduction to the guidelines of Clojure FP that we’ll refer to throughout the chapter. Next we’ll experience the power of lazy sequences by working through a series of implementations of the Fibonacci numbers. As cool as lazy sequences are, you rarely need to construct them yourself, and we’ll see better ways to recast problems to solve them directly with the sequence library.

We’ll close with some advanced techniques and see some scenarios where eager transformations have advantages over lazy sequences.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.226.187.233