You are previewing Programming Clojure, 2nd Edition.
O'Reilly logo
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.

Table of Contents

  1. Programming Clojure
    1. Copyright
    2. For the Best Reading Experience...
    3. Table of Contents
    4. What Readers Are Saying About Programming Clojure, Second Edition
    5. Foreword for the Second Edition
    6. Foreword for the First Edition
    7. Acknowledgments
    8. 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
    9. Chapter 1: Getting Started
      1. Why Clojure?
      2. Clojure Coding Quick Start
      3. Exploring Clojure Libraries
      4. Wrapping Up
    10. Chapter 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
    11. Chapter 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
    12. Chapter 4: Functional Programming
      1. Functional Programming Concepts
      2. How to Be Lazy
      3. Lazier Than Lazy
      4. Recursion Revisited
      5. Wrapping Up
    13. Chapter 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
    14. Chapter 6: Protocols and Datatypes
      1. Programming to Abstractions
      2. Interfaces
      3. Protocols
      4. Datatypes
      5. Records
      6. reify
      7. Wrapping Up
    15. Chapter 7: Macros
      1. When to Use Macros
      2. Writing a Control Flow Macro
      3. Making Macros Simpler
      4. Taxonomy of Macros
      5. Wrapping Up
    16. Chapter 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
    17. Chapter 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
    18. Chapter 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
    19. Appendix 1: Editor Support
    20. Appendix 2: Bibliography
      1. You May Be Interested In…