Book Image

Clojure Data Structures and Algorithms Cookbook

By : Rafik Naccache
Book Image

Clojure Data Structures and Algorithms Cookbook

By: Rafik Naccache

Overview of this book

Table of Contents (14 chapters)
Clojure Data Structures and Algorithms Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Introduction


Functions in Clojure are first-class citizens. You can pass them around like ordinary parameters, store them as any other value, and even generate them programmatically. But this special and privileged position allows for more advanced algorithmic techniques, adding to the expressive power of Clojure.

Indeed, functions allow for more complex transformations that can be reusable, compoundable, and decoupled from the data structures they operate on. They can even serve as the foundation of a whole new computation paradigm, bringing more expressive power to the developer.

In this chapter, we are going to cover how transformations, as privileged language constructs, can help in addressing many algorithmic challenges like those found in exploring alternative styles for mutual recursion, piling up transducers into a reusable tiny firewall and using an alternative programming method known as continuation passing style.

  • Building a recursive descent parser using trampoline: In this recipe...