The content on this site (source) is a categorized and manifold collection of documentation guides for the Clojure programming language and its ecosystem.

We recognize that different Clojure users have different level of expertise and separates content into several groups:

Essentials

What makes developing in Clojure unique is that we have a focus on interactive programming: not just the REPL (Read Eval Print Loop) that Clojure provides but working in an editor that integrates well with the REPL experience to allow you to evaluate your code, in small pieces, directly from your editor as you write the code. This provides immediate feedback as you are exploring your problem space and "growing" your application.

These first three sections should help you get Clojure and some basic tooling installed, learn the basics of the language, and get a good editor setup that allows you to program interactively.

Getting Started

If you're new to Clojure, this is a good place to start.

Introduction

A swift introduction to the Clojure language, covering most of the basics.

Editors for Clojure Development

A list of popular options for editing Clojure code and working with Clojure data.

Language Guides

Functions

Functions are at the heart of Clojure.

This guide covers:

  • How to define functions
  • How to invoke functions
  • Multi-arity functions
  • Variadic functions
  • Higher order functions
  • Other topics related to functions

clojure.core Overview (incomplete)

clojure.core is the core Clojure library.

This guide covers:

  • Key functions of clojure.core
  • Key macros of clojure.core
  • Key vars of clojure.core

Interoperability with Java

The Clojure language implementation is symbiotic with its host platform (the JVM), providing direct interoperability.

This guide covers:

  • How to instantiate Java classes
  • How to invoke Java methods
  • How to extend Java classes with proxy
  • How to implement Java interfaces with reify
  • How to generate Java classes with gen-class
  • Other topics related to interop

Namespaces

Namespaces organize Clojure functions.

This guide covers:

  • An overview of Clojure namespaces
  • How to define a namespace
  • How to use functions in other namespaces
  • require, refer and use
  • How to Look up and invoke a function by name
  • Common compilation exceptions and their causes
  • How code compilation works in Clojure

Polymorphism: Protocols and Multimethods

This guide covers:

  • What are polymorphic functions
  • Type-based polymorphism with protocols
  • Ad-hoc polymorphism with multimethods
  • How to create your own data types that behave like core Clojure data types

Collections and Sequences

This guide covers:

  • Collections in Clojure
  • Sequences in Clojure
  • Core collection types
  • Key operations on collections and sequences
  • Other topics related to collections and sequences

Concurrency & Parallelism

This guide covers:

  • An overview of concurrency hazards
  • Clojure's approach to state and identity
  • Immutable data structures
  • Reference types (atoms, vars, agents, refs)
  • Using Clojure functions with java.util.concurrent abstractions
  • The Reducers framework (Clojure 1.5+)
  • Other topics related to concurrency and runtime parallelism

Macros and Metaprogramming

This guide covers:

  • Clojure macros
  • Clojure compilation process
  • Other topics related to metaprogramming

Laziness and Lazy Sequences (incomplete)

This guide covers:

  • What are lazy sequences
  • How to create functions that produce lazy sequences
  • How to force evaluation
  • Pitfalls with lazy sequences

Glossary

This guide includes definitons of various Clojure-related terminology.

The Clojure Ecosystem

Getting Started with the Clojure CLI

This guide covers:

  • How to install the Clojure CLI
  • Accessing the REPL
  • How to create a minimal project
  • What is interactive development

Library Development and Distribution

This guide covers:

  • Creating new library projects with the Clojure CLI
  • Basic setup for library development
  • How to publish a library to GitHub
  • How to publish a library to Clojars

The Clojure Toolbox

This is a well-maintained directory of libraries, organized by category, and is interactively searchable.

Clojure Community

This guide covers:

  • Planet Clojure, mailing lists, IRC channel
  • Clojure conferences
  • Local Clojure user groups
  • Other Clojure community resources

Getting Started with Leiningen

This guide covers:

  • What is Leiningen and what it can do for you
  • How to create a project with Leiningen
  • How to manage project dependencies
  • Accessing the REPL
  • How to run tests for your project
  • How to run the app
  • How to compile your code and dependencies into a single JAR for deployment ("├╝berjar")
  • How to share (publish) a library

Leiningen Profiles

This guide covers:

  • What are Leiningen profiles
  • How to use them

Distributing Libraries with Leiningen

This guide covers:

  • How Clojure libraries are distributed
  • How to publish Clojure libraries to clojars.org
  • How to publish Clojure libraries to Maven Central
  • How to publish Clojure libraries to your own Maven repository

Writing Leiningen Plugins

This guide covers:

  • What Leiningen plugins can do
  • How to install Leiningen plugins
  • How to develop plugins
  • How to distribute plugins

Maven for Clojure Development

This guide covers:

  • An overview of Apache Maven
  • Maven Clojure plugin

Documentation Tools

  • Tools for generating documentation from docstrings and other project metadata.

Data Processing (Overview) (TBD)

This guide covers:

  • An overview of why Clojure is an excellent choice for data processing
  • Popular tools and libraries in the area

Tutorials and Cookbooks

Basic Web Development

A brief tutorial/walkthrough of building a small web app using Ring, Compojure, Hiccup, and H2.

Parsing XML in Clojure

This guide covers:

  • How to parse XML in Clojure with zippers (clojure.data.zip)

Growing a DSL with Clojure

How to create a simple DSL with Clojure.

Includes introductions to:

  • Multimethods
  • Hierarchies
  • Metaprogramming and the "Code as data" philosophy

Strings

This cookbook covers:

  • How to work with strings
  • How to work with characters
  • How to work with regular expressions
  • How to work with context-free grammars
  • How to format text

Mathematics

Includes coverage of facilities for doing math with Clojure.

Data Structures (TBD)

This cookbook covers:

  • Vectors
  • Maps
  • Lists
  • Sets
  • Generic operations on sequences

Files and Directories

This cookbook covers:

  • Reading and writing text and binary files
  • Listing directory contents
  • Creating files and directories
  • Moving files and directories
  • Removing files and directories
  • Accessing file metadata
  • Other operations on files and directories

Date and Time (TBD)

This guide covers:

  • Working with JDK dates
  • Working with Joda Time and clj-time
  • Instant literals (Clojure 1.4+)

Middleware (incomplete)

This guide covers:

  • What middleware is and how it works
  • Creating middleware for a client function
  • Combining middleware to create a new client

License

All the content is distributed under the CC BY 3.0 license and are copyright their respective primary author(s).

Tell Us What You Think!

Please take a moment to tell us what you think about this guide on the Clojurians Slack #clojure-doc channel or the Clojure mailing list.

Let us know what was unclear or what has not been covered. Maybe you do not like the guide style or grammar or discover spelling mistakes. Reader feedback is key to making the documentation better.