Buy it!
37% off with
code f1037

The Joy of Clojure

Thinking the Clojure Way

A book by Michael Fogus and Chris Houser

We’re really enjoying Clojure, and we’d like to share our knowledge and experience with you. The Joy of Clojure can now be pre-ordered, which gives you access to the first four chapters now, plus more as we write them. If you're not quite ready to buy, you can read the first chapter for free. For updates on the book itself and Clojure in general, check back here or subscribe at any of our news links listed below.

The table of contents is very much subject to change, but here are our current plans for the book:

News

Fogus:
Chouser:
TABLE OF CONTENTS
    1. Clojure
    2. A Book for the Adventurous
    3. Useful Examples
    4. Use Available Libraries
    5. A Word About Notation
    6. Getting Clojure
    7. Building Clojure
    8. Running Clojure
  1. Clojure -- A Lisp for the Java Virtual Machine
    1. Perhaps you've heard of Clojure?
    2. Why Learn About Clojure?
    3. Roadmap
    4. Summary
FOUNDATIONS
  1. Clojure Philosophy
    1. The Clojure Way
    2. Concurrency-oriented Programming
    3. Why Clojure is Not Especially Object-Oriented
    4. Functional Programming
    5. Why a(nother) Lisp?
    6. Java.next
    7. Understanding Variable Scope, Free Variables, and Closures
    8. Use the REPL to Experiment
    9. Summary
  2. Dipping Our Toes Into the Pool
    1. Take a Moment to Breathe
    2. Observe Basic Clojure Style
    3. Embrace Doc-strings
    4. Deploying your code: Compiling and Packaging
    5. Using Clojure As a Scripting Language
    6. Truthiness
    7. nil Pun With Care
    8. Using Destructuring
    9. Summary
DATA TYPES
  1. On Scalars
    1. What Makes Clojure Scalars So Special?
    2. Understanding Precision
    3. Try To Be Rational
    4. When To Use Keywords
    5. Symbolic Resolution
    6. Regular Expressions - The "Second Problem"
    7. Summary
  2. Composite Data Types
    1. "I do not think it means what you think it means"
    2. Always Work Against the Sequence Abstraction
    3. When To Use Vectors
    4. When To Use Lists
    5. When To Use Queues
    6. When To Use Sets
    7. When To Use Maps
    8. EXAMPLE: Universal Design Pattern
    9. Thinking In Maps
    10. Case Study: Finding the Position of Items in a Sequence
    11. Prefer Higher-order Functions For Sequence Processing
    12. Using Metadata
    13. Summary
FUNCTIONAL PROGRAMMING
  1. Being Lazy and Set in Your Ways
    1. On Immutability
    2. On Laziness
    3. Summary
  2. Functional Programming Idioms
    1. Functions
    2. Closures
    3. Recursion
    4. Summary
  3. Macros
    1. Macros Are Different
    2. Using Macros To Provide Control Flow
    3. Using Macros When Combining Forms
    4. Using Macros When Changing Forms
    5. Using Macros To Control Evaluation Time
    6. When Not To Use Macros
    7. Always Qualify Macro Vars
    8. Understanding the -> and ->> Macros
    9. EXAMPLE: Pattern Matching
    10. Summary
LARGE-SCALE DESIGN
  1. Combining Data and Code
    1. Namespaces
    2. Multimethods
    3. Types, Protocols, and Reify
  2. Interoperability
    1. Embracing Java
    2. Using Clojure In Your Java Programs
    3. Generating Java On the Fly
    4. Understand Clojure's Relationship to Java Arrays
    5. All Clojure Functions Implement...
    6. Simplify Your Singletons
    7. Using Clojure Functions As Strategies
    8. Be Aware of null
    9. Be Wary of Exceptions
    10. How To Extend Clojure
    11. Summary
CONCURRENCY
  1. Concurrency / Mutation Idioms
    1. What STM and Agents Make Easy
    2. When To Use Refs
    3. When To Use Agents
    4. When To Use Atoms
    5. When To Use Primitive Locking
    6. When To Use Futures
    7. When To Use Promise and Deliver
    8. When To Use pmap
    9. Understanding let
    10. Understanding binding
    11. EXAMPLE: Cells
    12. Summary
TANGENTIAL CONSIDERATIONS
  1. Performance
    1. Type Hints
    2. Transients
    3. Chunked Sequences
    4. Memoization
    5. Primitives and Coersion
    6. Avoiding Boxed Args with Macros or definline
    7. Hotspot Inlining and Escape Analysis
    8. Summary
  2. Clojure Will Change the Way You Program
    1. DSLs
    2. Testing
    3. Refactoring
    4. Summary
  1. Appendix A: Clojure's Bare Necessities
  2. Appendix B: Tool Support