contents

preface
acknowledgments
about this book

Part 1 Getting started

Chapter 1 Introduction to Clojure
What is Clojure?
Understanding Clojure syntax
The sources of Clojure’s power
Clojure—beyond object orientation
Summary
Chapter 2 A whirlwind tour
Getting started
Program structure
Program flow
Clojure data structures
Summary
Chapter 3 Building blocks of Clojure
Functions
Scope
Namespaces
Destructuring
Metadata
Summary
Chapter 4 Polymorphism with multimethods
Polymorphism
Method dispatch
Multimethods
Summary
Chapter 5 Clojure and Java interop
Calling Java from Clojure
Compiling Clojure code to Java byte code
Calling Clojure from Java
Summary
Chapter 6 State and the concurrent world
The problem with state
Identities and values
The Clojure way
Refs
Agents
Atoms
Vars
State and its unified access model
Watching for mutation
Futures and promises
Summary
Chapter 7 Evolving Clojure through macros
Macro basics
Macros from within Clojure
Writing your own macros
Summary

Part 2 Getting real

Chapter 8 Test-driven development and more
Getting started with TDD
Mocking and stubbing things
Organizing tests
Summary
Chapter 9 Data storage with Clojure
MySQL & clj-record
HBase
Redis
Summary
Chapter 10 Clojure and the web
An HTTP interface from scratch
Ring
Compojure
Generating HTML
Summary
Chapter 11 Scaling through messaging
Messaging systems
Clojure and RabbitMQ
Distributed parallel programming
Summary
Chapter 12 Data processing with Clojure
The map/reduce paradigm
Master/slave parallelization
Summary
Chapter 13 More on functional programming
Using higher-order functions
Partial application and currying
Closures
Summary
Chapter 14 Protocols, records, and types
The expression problem
Modus operandi
Protocols and data types
Summary
Chapter 15 More macros and DSLs
Macros
Domain-specific languages
Summary

          index