Programming Clojure

Free Download

Authors:

Edition: 1

Series: Pragmatic Programmers

ISBN: 1934356336, 9781934356333

Size: 2 MB (1688151 bytes)

Pages: 297/297

File format:

Language:

Publishing Year:

Category: Tags: , ,

Stuart Halloway1934356336, 9781934356333

Clojure is a dynamic language for the Java Virtual Machine, with a compelling combination of features: Clojure is elegant. Clojure’s clean, careful design lets you write programs that get right to the essence of a problem, without a lot of clutter and ceremony. Clojure is Lisp reloaded. Clojure has the power inherent in Lisp, but is not constrained by the history of Lisp. Clojure is a functional language. Data structures are immutable, and functions tend to be side-effect free. This makes it easier to write correct programs, and to compose large programs from smaller ones. Clojure is concurrent. Rather than error-prone locking, Clojure provides software transactional memory. Clojure embraces Java. Calling from Clojure to Java is direct, and goes through no translation layer. Clojure is fast. Wherever you need it, you can get the exact same performance that you could get from hand-written Java code. Many other languages offer some of these features, but the combination of them all makes Clojure sparkle. “Programming Clojure” shows you why these features are so important, and how you can use Clojure to build powerful programs quickly.

Table of contents :
Contents……Page 7
Foreword……Page 10
Acknowledgments……Page 12
Preface……Page 14
What Is in This Book……Page 15
How to Read This Book……Page 16
Notation Conventions……Page 18
Web Resources and Feedback……Page 19
Downloading Sample Code……Page 20
Why Clojure?……Page 21
Clojure Coding Quick Start……Page 30
Exploring Clojure Libraries……Page 37
Introducing Lancet……Page 42
Wrapping Up……Page 44
Forms……Page 45
Reader Macros……Page 55
Functions……Page 56
Vars, Bindings, and Namespaces……Page 60
Flow Control……Page 67
Where’s My for Loop?……Page 70
Metadata……Page 74
Wrapping Up……Page 77
Working with Java……Page 79
Calling Java……Page 80
Optimizing for Performance……Page 88
Creating and Compiling Java Classes in Clojure……Page 94
Exception Handling……Page 101
Adding Ant Projects and Tasks to Lancet……Page 105
Wrapping Up……Page 110
Unifying Data with Sequences……Page 111
Everything Is a Sequence……Page 112
Using the Sequence Library……Page 117
Lazy and Infinite Sequences……Page 125
Clojure Makes Java Seq-able……Page 127
Calling Structure-Specific Functions……Page 133
Adding Properties to Lancet Tasks……Page 141
Wrapping Up……Page 146
Functional Programming……Page 147
Functional Programming Concepts……Page 148
How to Be Lazy……Page 152
Lazier Than Lazy……Page 160
Recursion Revisited……Page 167
Wrapping Up……Page 176
Concurrency……Page 177
The Problem with Locks……Page 178
Refs and Software Transactional Memory……Page 179
Use Atoms for Uncoordinated, Synchronous Updates……Page 186
Use Agents for Asynchronous Updates……Page 187
Managing Per-Thread State with Vars……Page 192
A Clojure Snake……Page 196
Making Lancet Targets Run Only Once……Page 207
Wrapping Up……Page 210
When to Use Macros……Page 211
Writing a Control Flow Macro……Page 212
Making Macros Simpler……Page 218
Taxonomy of Macros……Page 224
Making a Lancet DSL……Page 233
Wrapping Up……Page 243
Multimethods……Page 244
Living Without Multimethods……Page 245
Defining Multimethods……Page 247
Moving Beyond Simple Dispatch……Page 249
Creating Ad Hoc Taxonomies……Page 251
When Should I Use Multimethods?……Page 255
Adding Type Coercions to Lancet……Page 259
Wrapping Up……Page 264
Clojure in the Wild……Page 265
Automating Tests……Page 266
Data Access……Page 270
Web Development……Page 275
Farewell……Page 283
Editor Support……Page 284
Bibliography……Page 285
B……Page 286
C……Page 287
F……Page 288
I……Page 289
L……Page 290
O……Page 291
R……Page 292
S……Page 293
W……Page 294
Z……Page 295

Reviews

There are no reviews yet.

Be the first to review “Programming Clojure”
Shopping Cart
Scroll to Top