liveBook · Manning

What you will learn in Clojure: The Essential Reference

by Renzo Borgatti

Chapter by chapter

Chapter 1: Know your tools

1.1 Why should I care about the Standard Library? · 1.2 Aren’t specifications just plain boring? · 1.3 The different versions of Clojure · 1.4 The Clojure Standard Library · 1.5 Making Your Development Life Easier · 1.6 The problem of fragmented information · 1.7 The well kept secret of the Clojure Ninja · 1.8 The perfect companion book · 1.9 Summary

What you learn in chapter 1 →

Chapter 2: Creating and manipulating functions

2.1 Function definition · 2.1.1 defn and defn- · 2.1.2 fn · 2.1.3 fn* · 2.2.1 fnil · 2.2.2 comp · 2.2.3 complement · 2.2.4 constantly · 2.2.5 identity · 2.2.6 juxt · 2.2.7 memfn · 2.2.8 partial · 2.2.9 every-pred and some-fn · 2.3.1 -> · 2.3.2 ->> · 2.3.3 cond-> and cond->> · 2.3.4 some-> and some->> · 2.3.5 as-> · 2.4.1 apply · 2.4.2 memoize · 2.4.3 trampoline · 2.5 Summary

What you learn in chapter 2 →

Chapter 3: Basic constructs

3.1 Lexical Binding · 3.1.1 let and let* · 3.1.2 if-let, when-let, if-some and when-some · 3.1.3 letfn and letfn* · 3.2 Boolean and Bitwise Operators · 3.2.1 not · 3.2.2 and, or · 3.2.3 bit-and and bit-or · 3.3 Conditional Branching · 3.3.1 if, if-not, when and when-not · 3.3.2 cond · 3.3.3 condp · 3.3.4 case · 3.4 Iteration and loops · 3.4.1 loop, recur and loop* · 3.4.2 range · 3.4.3 for · 3.4.4 while · 3.4.5 dotimes · 3.5 A Glimpse of Collection Processing · 3.5.1 first, second and last · 3.5.2 map and map-indexed · 3.5.3 filter and remove · 3.5.4 reduce and reductions · 3.6 Summary

What you learn in chapter 3 →

Chapter 4: Creating and inspecting macros

4.1 defmacro · 4.2 macroexpand, macroexpand-1 and macroexpand-all · 4.3 quote · 4.4 gensym · 4.5 definline · 4.6 destructure · 4.7 clojure.template/apply-template · 4.8 clojure.template/do-template · 4.9 Summary

What you learn in chapter 4 →

Chapter 5: Operations on numbers

5.1 Overview · 5.2 Arbitrary precision · 5.3 Roll-over Precision · 5.4 Non-casting, roll-over Precision · 5.5 +, -, * and / · 5.6 inc and dec · 5.7 quot, rem and mod · 5.8 max and min · 5.9 max-key and min-key · 5.10 rand and rand-int · 5.11 with-precision · 5.12 +', -', *', inc' and dec' · 5.13 unchecked-add and other unchecked operators · 5.14 unchecked-add-int and other unckecked-int operators · 5.15 pos?, zero? and neg? · 5.16 Summary

What you learn in chapter 5 →

Chapter 6: Comparison and equality

6.1 = (equal) and not= (not equal) · 6.2 == (double equal) · 6.3 < , > , <= , >= · 6.4 compare · 6.5 identical? · 6.6 hash · 6.7 clojure.data/diff · 6.8 Summary

What you learn in chapter 6 →

Chapter 7: Reducers and transducers

7.1 Reducers · 7.1.1 fold · 7.1.2 reducer and folder · 7.1.3 monoid · 7.1.4 foldcat, cat and append! · 7.2 Transducers · 7.2.1 transduce · 7.2.2 eduction · 7.2.3 completing · 7.2.4 cat · 7.3 reduced, reduced?, ensure-reduced, unreduced · 7.4 Summary

What you learn in chapter 7 →

Chapter 8: Collections

8.1.1 into · 8.1.2 count · 8.1.3 nth · 8.1.4 empty · 8.1.5 every?, not-every?, some and not-any? · 8.1.6 empty? and not-empty · 8.2 Polymorphic · 8.2.1 conj · 8.2.2 get · 8.2.3 contains? · 8.3 General purpose · 8.3.1 rand-nth · 8.3.2 shuffle · 8.3.3 random-sample · 8.3.4 frequencies · 8.3.5 sort and sort-by · 8.3.6 group-by · 8.3.7 replace · 8.3.8 reverse · 8.4 Traversing · 8.4.1 walk, prewalk-demo and postwalk-demo · 8.4.2 prewalk and postwalk · 8.4.3 prewalk-replace and postwalk-replace · 8.4.4 clojure.zip · 8.5 Summary

What you learn in chapter 8 →

Chapter 9: Sequences

9.1 Sequential Collections · 9.1.1 seq and sequence · 9.1.2 rseq · 9.1.3 subseq and rsubseq · 9.1.4 seque · 9.1.5 pmap, pcalls and pvalues · 9.2 Abstract Generators · 9.2.1 repeatedly · 9.2.2 iterate · 9.2.3 repeat and cycle · 9.3 Other Generators · 9.3.1 lazy-seq · 9.3.2 tree-seq · 9.3.3 file-seq · 9.3.4 xml-seq · 9.3.5 re-seq · 9.3.6 line-seq · 9.3.7 resultset-seq · 9.3.8 iterator-seq and enumeration-seq · 9.3.9 concat and lazy-cat · 9.4 Lists · 9.4.1 list · 9.4.2 cons and list* · 9.5 Summary

What you learn in chapter 9 →

Chapter 10: Sequential processing

10.1 rest, next, fnext, nnext, ffirst, nfirst and butlast · 10.2 drop, drop-while, drop-last, take, take-while, take-last, nthrest, nthnext · 10.3 keep and keep-indexed · 10.4 mapcat · 10.5 interpose and interleave · 10.6 partition, partition-all and partition-by · 10.7 flatten · 10.8 distinct, dedupe and distinct? · 10.9 take-nth · 10.10 split-at and split-with · 10.11 when-first · 10.12 chunk-cons, chunk-first, chunk-rest, chunk-next, chunk-buffer, chunk-append and chunk · 10.13 Summary

What you learn in chapter 10 →

Chapter 11: Maps

11.1.1 hash-map · 11.1.2 array-map · 11.1.3 sorted-map and sorted-map-by · 11.1.4 create-struct, defstruct, struct-map, struct and accessor · 11.1.5 zipmap · 11.2.1 keys and vals · 11.2.2 find, key and val · 11.2.3 select-keys and get-in · 11.3.1 assoc, assoc-in and dissoc · 11.3.2 update and update-in · 11.3.3 merge and merge-with · 11.3.4 reduce-kv · 11.4 Utility functions · 11.4.1 clojure.walk/keywordize-keys and clojure.walk/stringify-keys · 11.4.2 clojure.set/rename-keys · 11.4.3 clojure.set/map-invert · 11.5 Summary

What you learn in chapter 11 →

Chapter 12: Vectors

12.1 Thanks to Rachel Bowyer for contributing this chapter. · 12.2 Functions that operate on vectors · 12.3 The four types of vectors · 12.4 vector · 12.5 vec · 12.6 peek and pop · 12.7 vector-of · 12.8 mapv · 12.9 filterv · 12.10 subvec · 12.11 Summary

What you learn in chapter 12 →

Chapter 13: Sets

13.1 hash-set · 13.2 set · 13.3 sorted-set and sorted-set-by · 13.4 disj · 13.5 union, difference and intersection · 13.6.1 → namespace: clojure.set · 13.7.1 → namespace: clojure.set · 13.8 Summary

What you learn in chapter 13 →

Chapter 14: Concurrency

14.1 future · 14.2 promise and deliver · 14.3 delay · 14.4 ref · 14.5 atom · 14.6 agent · 14.7 deref and realized? · 14.8 set-validator! and get-validator · 14.9 add-watch and remove-watch · 14.10 locking, monitor-enter and monitor-exit · 14.11 Summary

What you learn in chapter 14 →

Chapter 15: Types, classes, hierarchies and polymorphism

15.1 symbol and keyword · 15.2 Type Checking and Coercion · 15.3 gen-class and gen-interface · 15.4 deftype and definterface · 15.5 proxy · 15.6 reify · 15.7 defrecord · 15.8 defprotocol · 15.9 extend, extend-type and extend-protocol · 15.10 derive and make-hierarchy · 15.11 defmulti and defmethod · 15.12 Summary

What you learn in chapter 15 →

Chapter 16: Vars and namespaces

16.1 def, declare, intern and defonce · 16.2 var, find-var and resolve · 16.3 alter-var-root and with-redefs · 16.4 binding · 16.5 with-local-vars, var-get and var-set · 16.6 ns, in-ns, create-ns and remove-ns · 16.7 alias, ns-aliases and ns-unalias · 16.8 ns-map and ns-unmap · 16.9 ns-publics, ns-interns, ns-imports · 16.10 refer, refer-clojure, require, loaded-libs, use, import · 16.11 find-ns and all-ns · 16.12 the-ns, ns-name and namespace · 16.13 meta, with-meta, vary-meta, alter-meta! and reset-meta! · 16.14 Summary

What you learn in chapter 16 →

Chapter 17: Evaluation

17.1 read and read-string · 17.2 eval · 17.3 load, load-file, load-reader and load-string · 17.4 compile · 17.5 test and assert · 17.6 clojure.edn/read and clojure.edn/read-string · 17.7 tagged-literal and tagged-literal? · 17.8 default-data-readers · 17.9 reader-conditional and reader-conditional? · 17.10 Summary

What you learn in chapter 17 →

Chapter 18: Formatting and printing

18.1 format, printf and cl-format · 18.2 pr, prn, pr-str, prn-str, print, println, print-str, println-str · 18.3 pprint, pp, write and print-table · 18.4 print-method, print-dup and print-ctor · 18.5 slurp and spit · 18.6 Summary

What you learn in chapter 18 →

Chapter 19: Strings and regular expressions

19.1 str · 19.2 join · 19.3 replace, replace-first, re-quote-replacement · 19.4 subs, split and split-lines · 19.5 trim, triml, trimr, trim-newline · 19.6 escape, char-name-string, char-escape-string · 19.7 lower-case, upper-case, capitalize · 19.8 index-of, last-index-of · 19.9 blank?, ends-with?, starts-with?, includes? · 19.10 re-pattern, re-matcher, re-groups, re-seq, re-matches, re-find · 19.11 Summary

What you learn in chapter 19 →

Chapter 20: Mutation and side effects

20.1 transient, persistent!, conj!, pop!, assoc!, dissoc! and disj! · 20.2 doseq, dorun, run!, doall, do · 20.3 volatile!, vreset!, vswap! and volatile? · 20.4 set! · 20.5 Summary

What you learn in chapter 20 →

Chapter 21: Java interoperability

21.1 ".", ".." and doto · 21.2 new · 21.3 try, catch, finally and throw · 21.4 ex-info and ex-data · 21.5 bean · 21.6 reflect and type-reflect · 21.7 Java Arrays · 21.7.1 make-array · 21.7.2 object-array and other typed initializers · 21.7.3 to-array, into-array, to-array-2d · 21.7.4 aget, aset, alength and aclone · 21.7.5 amap and areduce · 21.7.6 aset-int and other types setters · 21.7.7 ints and other typed array casting

What you learn in chapter 21 →

Chapter 22: The toolbox

22.1 clojure.xml · 22.2 clojure.inspector · 22.3 clojure.repl · 22.4 clojure.main · 22.5 clojure.java.browse · 22.6 clojure.java.shell · 22.7 clojure.core.server · 22.8 clojure.java.io · 22.9 clojure.test · 22.10 clojure.java.javadoc

What you learn in chapter 22 →

Chapter 23: Dynamic variables in the standard library

23.1 *1, *2, *3 and *e · 23.2 *in*, *out* and *err* · 23.3 *agent* · 23.4 *assert* · 23.5 *clojure-version* and *command-line-args* · 23.6 *compile-files* · 23.7 *compile-path* · 23.8 *compiler-options* · 23.9 *file* and *source-path* · 23.10 *use-context-classloader* · 23.11 *allow-unresolved-vars* · 23.12 *read-eval* and *suppress-read* · 23.13 *data-readers* and *default-data-reader-fn* · 23.14 *load-tests* and *stack-trace-depth* · 23.15 *feeling-lucky*, *local-javadocs* and *core-java-api* · 23.16 *flush-on-newline* · 23.17 *ns* and *loading-verbosely* · 23.18 *math-context* · 23.19 *warn-on-reflection* and *unchecked-math* · 23.20 Pretty printing variables · 23.21 Other Dynamic Variables · 23.22 Summary

What you learn in chapter 23 →

Concepts explained in this book

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.