Programming Clojure, Fourth Edition
by: Alex Miller
| Published | 2026-05-10 |
|---|---|
| Internal code | shcloj4 |
| Print status | In Print |
| Pages | 320 |
| User level | Beginner |
| Keywords | clojure, lisp, functional programming, concurrency, JVM, clojurescript |
| Related titles | “Clojure Brain Teasers” is a series of short teaser examples paired with explanations of the result. It is useful to read in tandem with Programming Clojure to explore a reader’s understanding of how Clojure works. “Getting Clojure” is an alternate introduction to Clojure, with a gentler approach and catering more to users of other dynamic languages like Ruby or Python. “Clojure Applied” is the logical successor to this book, showing the next level of how to design and implement applications once you’re familiar with the language itself. “Web Development with Clojure” shows how to user Clojure for the domain of web development. “Mastering Clojure Macros” is a follow-up deep dive into one specific area covered at an introductory level in this book. |
| ISBN | 9798888651919 |
| Other ISBN |
Channel epub: 9798888652138 Channel PDF: 9798888652138 Kindle: 9798888652138 Safari: 9798888652138 Kindle: 9798888652138 |
| BISACs | COM051010COM051280COM051280 |
Highlight
Struggling with unnecessary complexity, unmanaged state, and brittle data that’s hard to change? Clojure combines the expressiveness of Lisp with the stability and performance of Java into a practical toolkit for creating simple, extensible applications. With immutable data structures, functional programming, and safe concurrency, Clojure makes it easier to write robust, reusable code. This definitive guide, written by members of the Clojure core team, introduces the language’s essentials and then shows how to put everything together in real applications. This edition adds practical coverage of project tooling and interactive development and fresh examples of the latest Clojure features.
Description
Build cleaner, more reliable software that can respond to changing requirements over time. Combine Clojure’s tools for maximum effectiveness as you work with immutable data, functional programming, and safe concurrency to write programs that solve real-world problems.
Start by getting comfortable with Clojure’s concise syntax and its interactive REPL, then quickly move into building with immutable collections and the powerful sequence abstraction. Gain practical fluency with functional techniques such as higher-order functions, recursion, partial application, and memoization. Beyond the basics, learn to manage state with Clojure’s reference types, build open and extensible systems using protocols and multimethods, and unlock the power of macros for creating your own language features. Seamless Java interop lets you tap into the vast Java ecosystem without sacrificing clarity or safety.
This edition adds two new chapters on project tooling and interactive development, guiding you through modern workflows with tests, builds, editors, and the REPL at the center of your process. Learn how to set up projects, manage dependencies, and work productively in Clojure’s unique interactive style. When you’re finished, you’ll be able to think in Clojure: express solutions with clarity, leverage concurrency safely, and build real-world applications that are simpler and more maintainable than you thought possible.
Contents and Extracts
- Welcome to Clojure
- Getting Started
- Simplicity and Power in Action
- Clojure Coding Quick Start
- Navigating Clojure Namespaces
- Wrapping Up
- Exploring Clojure
- Reading Clojure
- Functions
- Vars, Bindings, and Namespaces
- Metadata
- Calling Java
- Comments
- Flow Control
- Where’s My for Loop?
- Wrapping Up
- Developing Interactively
- The REPL (Read-Eval-Print-Loop)
- Editors
- Structural Editing
- Loading and Evaluating Code
- Dependencies in the REPL
- Wrapping Up
- Getting Started
- Data and Functions
- Unifying Data with Sequences
- Everything Is Seq-able
- Using the Sequence Functions
- Lazy and Infinite Sequences
- Clojure Makes Java Seq-able
- Calling Structure-Specific Functions
- Wrapping Up
- Functional Programming
- Functional Programming Concepts
- How to Be Lazy
- Lazier Than Lazy
- Recursion Revisited
- Eager Transformations
- Wrapping Up
- Describing Your Data with Specs
- Defining Specs
- Validating Data
- Validating Functions
- Generative Function Testing
- Wrapping Up
- Unifying Data with Sequences
- Intermediate Topics
- State and Concurrency
- Concurrency, Parallelism, and Locking
- Use Atoms for Uncoordinated, Synchronous Updates
- Refs and Software Transactional Memory
- Use Agents for Asynchronous Updates
- Managing Per-Thread State with Vars
- A Clojure Snake
- Wrapping Up
- Protocols and Datatypes
- Programming to Abstractions
- Interfaces
- Protocols
- Datatypes
- Records
- reify
- Metadata Extension
- Wrapping Up
- Multimethods
- Living Without Multimethods
- Defining Multimethods
- Moving Beyond Simple Dispatch
- Creating Ad Hoc Taxonomies
- When Should I Use Multimethods?
- Wrapping Up
- Java Interop
- Creating Java Objects in Clojure
- Calling Clojure From Java
- Exception Handling
- Optimizing for Performance
- Handling Java Streams
- A Real-World Example
- Wrapping Up
- Macros
- When to Use Macros
- Writing a Control Flow Macro
- Making Macros Simpler
- Taxonomy of Macros
- Wrapping Up
- State and Concurrency
- Clojure in Practice
- Project Tooling
- Project Sources and Dependencies
- Running a REPL
- Defining Tests
- Running Tests
- Building and Releasing Libraries
- Compiling Applications
- Wrapping Up
- Building an Application
- Getting Started
- Developing the Game Loop
- Representing Progress
- Implementing Players
- Interactive Play
- Documenting and Testing Your Game
- Farewell
- Project Tooling