Log In
Or create an account ->
Imperial Library
Home
About
News
Upload
Forum
Help
Login/SignUp
Index
Getting Clojure
About the Pragmatic Bookshelf
Table of Contents
Early Praise for Getting Clojure: Build Your Functi onal Skills One Idea at a Time
Acknowledgments
Preface
Who Is This Book For?
How Is This Book Organized?
About the Code Examples
Online Resources
Pa rt 1 Basics
Chapter 1: Hello, Clojure
The Very Basics
Arithmetic
Not Variable Assignment, but Close
A Function of Your Own
In the Wild
Staying Out of Trouble
Wrapping Up
Chapter 2: Vectors and Lists
One Thing After Another
A Toolkit of Functions
Growing Your Vectors
Lists
Lists versus Vectors
Staying Out of Trouble
In the Wild
Wrapping Up
Chapter 3: Maps, Keywords, and Sets
This Goes with That
Keywords
Changing Your Map Without Changing It
Other Handy Map Functions
Sets
In the Wild
Staying Out of Trouble
Wrapping Up
Chapter 4: Logic
The Fundamental If
Asking Questions
Truthy and Falsy
Do and When
Dealing with Multiple Conditions
Throwing and Catching
In the Wild
Staying Out of Trouble
Wrapping Up
Chapter 5: More Capable Functions
One Function, Different Parameters
Arguments with Wild Abandon
Multimethods
Deeply Recursive
Docstrings
Pre and Post Conditions
Staying Out of Trouble
In the Wild
Wrapping Up
Chapter 6: Functional Things
Functions Are Values
Functions on the Fly
A Functional Toolkit
Function Literals
In the Wild
Staying Out of Trouble
Wrapping Up
Chapter 7: Let
A Local, Temporary Place for Your Stuff
Let Over Fn
Variations on the Theme
In the Wild
Staying Out of Trouble
Wrapping Up
Chapter 8: Def, Symbols, and Vars
A Global, Stable Place for Your Stuff
Symbols Are Things
Bindings Are Things Too
Varying Your Vars
Staying Out of Trouble
In the Wild
Wrapping Up
Chapter 9: Namespaces
A Place for Your Vars
Loading Namespaces
A Namespace of Your Own
As and Refer
Namespaces, Symbols, and Keywords
In the Wild
Staying Out of Trouble
Wrapping Up
Part 2: Intermediate
Chapter 10: Sequences
One Thing After Another
A Universal Interface
A Rich Toolkit …
… Made Richer with Functional Values
Map
Reduce
Composing a Solution
Other Sources of Sequences
In the Wild
Staying Out of Trouble
Wrapping Up
Chapter 11: Lazy Sequences
Sequences Without End
More Interesting Laziness
Lazy Friends
Laziness in Practice
Behind the Scenes
Staying Out of Trouble
In the Wild
Wrapping Up
Chapter 12: Destructuring
Pry Open Your Data
Getting Less than Everything
Destructuring in Sequence
Destructuring Function Arguments
Digging into Maps
Diving into Nested Maps
The Final Frontier: Mixing and Matching
Going Further
Staying Out of Trouble
In the Wild
Wrapping Up
Chapter 13: Records and Protocols
The Trouble with Maps
Striking a More Specific Bargain with Records
Records Are Maps
The Record Advantage
Protocols
Decentralized Polymorphism
Record Confusion
In the Wild
Staying Out of Trouble
Wrapping Up
Chapter 14: Tests
Spotting Bugs with clojure.test
Testing Namespaces and Projects
Property-Based Testing
Checking Properties
Staying Out of Trouble
In the Wild
Wrapping Up
Chapter 15: Spec
This Is the Data You’re Looking For
Spec’ing Collections
Registering Specs
Spec’ing Maps (Again)
Why? Why? Why?
Function Specs
Spec-Driven Tests
Staying Out of Trouble
In the Wild
Wrapping Up
Part 3: Advanced
Chapter 16: Interoperating with Java
A Peek at Java …
… And Back to Clojure
Packages
Class Methods and Fields
In the Wild
Staying Out of Trouble
Wrapping Up
Chapter 17: Threads, Promises, and Futures
Great Power …
… And Great Responsibility
Good Fences Make Happy Threads
Promise Me a Result
A Value with a Future
Staying Out of Trouble
In the Wild
Wrapping up
Chapter 18: State
It’s Made of Atoms
Swapping Maps
Refs: Team-Oriented Atoms
Agents
Choose Wisely
In the Wild
Staying Out of Trouble
Wrapping Up
Chapter 19: Read and Eval
You Got Data On My Code!
Reading and Evaluating
The Homoiconic Advantage
An Eval of Your Own
In the Wild
Staying Out of Trouble
Wrapping Up
Chapter 20: Macros
There Are Three Kinds of Numbers in the World
Macros to the Rescue
Easier Macros with Syntax Quoting
In the Wild
Staying Out of Trouble
Wrapping Up
Chapter 21: Conclusion
You May Be Interested In…
← Prev
Back
Next →
← Prev
Back
Next →