O'Reilly logo

Living Clojure by Carin Meier

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 11. Further Adventures

The focus of this book has been on the core and most important parts of Clojure that you will need to know to get you going. This was done to ease the cognitive load in learning a new way of thinking. But there is so much more to explore and learn. Clojure is a rich ecosystem with many beautiful areas behind every corner. In this chapter, we are going to mention some suggested areas to explore.

The first area to look at is where Clojure as a language is headed. As this book is being written, Clojure 1.7 is getting ready to be released. One of the innovations it will bring, is a new fundamental concept called transducers.

Get Ready for Transducers

Transducers are a way of decoupling transformations from the data structures. One advantage to this decoupling is that these transformations can be reused and composed. Transducers are bit hard to explain in words, so let’s see them in action. We will be using a simple example from Alice in Wonderland to illustrate them. We will be taking a collection of transformations to make words acceptable to be in the Queen of Hearts garden.

The first thing we need to do is create a new project and grab the latest version of Clojure 1.7 as well as core.async, which we will be also using.

At a command prompt, type the following:

lein new queen-of-hearts

Next, go ahead a open the project.clj page and edit it so that you have the following dependencies:

(defproject queen-of-hearts "0.1.0-SNAPSHOT"
  :description "FIXME: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required