Programming Clojure, 2nd Edition

Book description

If you want to keep up with the significant changes in this important language, you need the second edition of Programming Clojure. Stu and Aaron describe the modifications to the numerics system in Clojure 1.3, explain new Clojure concepts such as Protocols and Datatypes, and teach you how to think in Clojure.

Publisher resources

View/Submit Errata

Table of contents

  1.  Foreword for the Second Edition
  2.  Foreword for the First Edition
  3.  Acknowledgments
  4.  Preface
    1. Who This Book Is For
    2. What Is in This Book
    3. How to Read This Book
    4. Notation Conventions
    5. Web Resources and Feedback
    6. Downloading Sample Code
  5. 1. Getting Started
    1. Why Clojure?
    2. Clojure Coding Quick Start
    3. Exploring Clojure Libraries
    4. Wrapping Up
  6. 2. Exploring Clojure
    1. Forms
    2. Reader Macros
    3. Functions
    4. Vars, Bindings, and Namespaces
    5. Calling Java
    6. Flow Control
    7. Where’s My for Loop?
    8. Metadata
    9. Wrapping Up
  7. 3. Unifying Data with Sequences
    1. Everything Is a Sequence
    2. Using the Sequence Library
    3. Lazy and Infinite Sequences
    4. Clojure Makes Java Seq-able
    5. Calling Structure-Specific Functions
    6. Wrapping Up
  8. 4. Functional Programming
    1. Functional Programming Concepts
    2. How to Be Lazy
    3. Lazier Than Lazy
    4. Recursion Revisited
    5. Wrapping Up
  9. 5. State
    1. Concurrency, Parallelism, and Locking
    2. Refs and Software Transactional Memory
    3. Use Atoms for Uncoordinated, Synchronous Updates
    4. Use Agents for Asynchronous Updates
    5. Managing Per-Thread State with Vars
    6. A Clojure Snake
    7. Wrapping Up
  10. 6. Protocols and Datatypes
    1. Programming to Abstractions
    2. Interfaces
    3. Protocols
    4. Datatypes
    5. Records
    6. reify
    7. Wrapping Up
  11. 7. Macros
    1. When to Use Macros
    2. Writing a Control Flow Macro
    3. Making Macros Simpler
    4. Taxonomy of Macros
    5. Wrapping Up
  12. 8. Multimethods
    1. Living Without Multimethods
    2. Defining Multimethods
    3. Moving Beyond Simple Dispatch
    4. Creating Ad Hoc Taxonomies
    5. When Should I Use Multimethods?
    6. Wrapping Up
  13. 9. Java Down and Dirty
    1. Exception Handling
    2. Wrestling with the Integers
    3. Optimizing for Performance
    4. Creating Java Classes in Clojure
    5. A Real-World Example
    6. Wrapping Up
  14. 10. Building an Application
    1. Scoring a Clojurebreaker Game
    2. Testing the Scorer
    3. test.generative
    4. Creating an Interface
    5. Deploying Your Code
    6. Farewell
  15. A1. Editor Support
  16. A2. Bibliography

Product information

  • Title: Programming Clojure, 2nd Edition
  • Author(s): Stuart Halloway, Aaron Bedra
  • Release date: April 2012
  • Publisher(s): Pragmatic Bookshelf
  • ISBN: 9781934356869