Foreword | p. xi |
Acknowledgments | p. xiii |
Preface | p. xv |
Who This Book Is For | p. xvi |
What Is in This Book | p. xvi |
How to Read This Book | p. xvii |
Notation Conventions | p. xix |
Web Resources and Feedback | p. xx |
Downloading Sample Code | p. xxi |
Getting Started | p. 1 |
Why Clojure? | p. 1 |
Clojure Coding Quick Start | p. 10 |
Exploring Clojure Libraries | p. 17 |
Introducing Lancet | p. 22 |
Wrapping Up | p. 24 |
Exploring Clojure | p. 25 |
Forms | p. 25 |
Reader Macros | p. 35 |
Functions | p. 36 |
Vars, Bindings, and Namespaces | p. 40 |
Flow Control | p. 47 |
Where's My for Loop? | p. 50 |
Metadata | p. 54 |
Wrapping Up | p. 57 |
Working with Java | p. 59 |
Calling Java | p. 60 |
Optimizing for Performance | p. 68 |
Creating and Compiling Java Classes in Clojure | p. 74 |
Exception Handling | p. 81 |
Adding Ant Projects and Tasks to Lancet | p. 85 |
Wrapping Up | p. 90 |
Unifying Data with Sequences | p. 91 |
Everything Is a Sequence | p. 92 |
Using the Sequence Library | p. 97 |
Lazy and Infinite Sequences | p. 105 |
Clojure Makes Java Seq-able | p. 107 |
Calling Structure-Specific Functions | p. 113 |
Adding Properties to Lancet Tasks | p. 121 |
Wrapping Up | p. 126 |
Functional Programming | p. 127 |
Functional Programming Concepts | p. 128 |
How to Be Lazy | p. 132 |
Lazier Than Lazy | p. 140 |
Recursion Revisited | p. 147 |
Wrapping Up | p. 156 |
Concurrency | p. 157 |
The Problem with Locks | p. 158 |
Refs and Software Transactional Memory | p. 159 |
Use Atoms for Uncoordinated, Synchronous Updates | p. 166 |
Use Agents for Asynchronous Updates | p. 167 |
Managing Per-Thread State with Vars | p. 172 |
A Clojure Snake | p. 176 |
Making Lancet Targets Run Only Once | p. 187 |
Wrapping Up | p. 190 |
Macros | p. 191 |
When to Use Macros | p. 191 |
Writing a Control Flow Macro | p. 192 |
Making Macros Simpler | p. 198 |
Taxonomy of Macros | p. 204 |
Making a Lancet DSL | p. 213 |
Wrapping Up | p. 223 |
Multimethods | p. 225 |
Living Without Multimethods | p. 226 |
Defining Multimethods | p. 228 |
Moving Beyond Simple Dispatch | p. 230 |
Creating Ad Hoc Taxonomies | p. 232 |
When Should I Use Multimethods? | p. 236 |
Adding Type Coercions to Lancet | p. 240 |
Wrapping Up | p. 245 |
Clojure in the Wild | p. 247 |
Automating Tests | p. 248 |
Data Access | p. 252 |
Web Development | p. 257 |
Farewell | p. 265 |
Editor Support | p. 267 |
Bibliography | p. 269 |
Index | p. 271 |
Table of Contents provided by Ingram. All Rights Reserved. |
The New copy of this book will include any supplemental materials advertised. Please check the title of the book to determine if it should include any access cards, study guides, lab manuals, CDs, etc.
The Used, Rental and eBook copies of this book are not guaranteed to include any supplemental materials. Typically, only the book itself is included. This is true even if the title states it includes any access cards, study guides, lab manuals, CDs, etc.