Chapter 2. Interacting with Collections

In this chapter, we will cover the following topics:

  • Clojure collections and their basic functions
  • Accessing and updating elements from collections
  • Filtering elements from collections
  • Transforming and sorting collections
  • Merging and splitting collections
  • How to become lazy

Introduction

Clojure belongs to the Lisp language family, and Lisp can handle collections in a very cool and efficient way. Clojure inherits rich and cool sets from Lisp. In this chapter, we will show basic and advanced recipes for manipulating collections.

Another advantage of manipulating collections in Clojure is to guarantee immutability. In the case of large or concurrent applications, mutability causes unintended behaviors resulting in serious ...

Get Clojure Programming Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.