Clojure Cookbook - Recipes for Functional Programming
The primary goal of this book is to provide mid-length examples of Clojure code that
go beyond the basics, with a focus on real-world, everyday applications (as opposed to
more conceptual or academic issues).
Unlike many of the other books on Clojure written to date, the organizing theme of this
book is not the language itself, or its features and capabilities. Instead, it focuses on
specific tasks that developers face (regardless of what language they’re using) and shows
an example of how to use Clojure to solve each of those specific problems.
As such, this book is not and cannot be truly comprehensive; there are infinite possible
example problems. However, we do hope we’ve documented some of the more common
ones that most programmers encounter frequently, and that by induction readers will
be able to learn some common patterns, approaches, and techniques that will serve them
well as they design solutions for their own unique problems.
How This Book Was Written
An important thing you should understand about this book is that it is, first and foremost,
a group effort. It is not authored by one or two people. It isn’t even the work of a
single, well-defined group. Instead, it is the collaborative product of more than 60 of
the best Clojurists from all over the world, from all backgrounds. These authors use
Clojure every day on real applications, ranging from aerospace to social media, banking
to robotics, AI research to e-commerce.
As such, you will see a lot of diversity in the recipes presented. Some are quick and to
the point. Others are more deliberate, presenting digestible yet penetrating insights into
the philosophy and implementation of certain aspects of Clojure.
We hope that there is something in this book for readers of diverse interests. We believe
that it will be useful not only as a reference for looking up solutions to specific problems,
but also as a worthwhile survey of the variety and expressivity that Clojure is capable of. As we edited submissions, we were astonished by the number of concepts and techniques
that were new to us, and will hopefully be new to our readers as well.
Something else that we discovered while writing and editing was how difficult it was to
draw a circumference around what we wanted to cover. Every single recipe is a beautiful,
endless fractal, touching multiple topics, each of which deserves a recipe, a chapter, or
a book of its own. But each recipe also needs to stand on its own. Each one should
provide some useful nugget of information that readers can understand and take away
We sincerely hope that we have balanced these goals appropriately, and that you find
this book useful without being tedious, and insightful without being pedantic.