Chapter 6. Being lazy and set in your ways
This chapter covers
- Designing a persistent toy
- A lazy quicksort
We mentioned in section 1.3 that the definitions of functional programming are widely disparate, and unfortunately this book won’t work to unify them. Instead, we’ll start in this chapter to build a basis for Clojure’s style of functional programming by digging into its core supporting maxims: immutable data and laziness. In addition, this chapter covers in greater depth the parts of Clojure’s composite types that we’ve only touched on. It will conclude with a sorting function that uses both maxims in a way we find to be mentally invigorating.
6.1. On immutability: being set in your ways
We’ve touched on immutability ...