Skip to Main Content
The Joy of Clojure, Second Edition
book

The Joy of Clojure, Second Edition

by Michael Fogus, Chris Houser
May 2014
Intermediate to advanced content levelIntermediate to advanced
520 pages
17h 23m
English
Manning Publications
Content preview from The Joy of Clojure, Second Edition

Chapter 5. Collection types

It’s better to have 100 functions operate on one data structure than 10 functions on 10 data structures.

Alan Perlis[1]

1 “Epigrams on Programming,” ACM SIGPLAN 17, no. 9 (September 1982).

This chapter covers

  • Persistence, sequences, and complexity
  • Vectors: creating and using them in all their varieties
  • Lists: Clojure’s code form data structure
  • How to use persistent queues
  • Persistent sets
  • Thinking in maps
  • Finding the position of items in a sequence

Clojure provides a rich set of composite data types, or collection types, and we’ll cover them all: vectors, lists, queues, sets, and maps. In this chapter, we’ll dig into the strengths and weaknesses of each. We’ll spend more time on vectors and maps than ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Living Clojure

Living Clojure

Carin Meier
Clojure in Action, Second Edition

Clojure in Action, Second Edition

Amit Rathore, Francis Avila
Getting Clojure

Getting Clojure

Russ Olsen
Programming Clojure, 3rd Edition

Programming Clojure, 3rd Edition

Alex Miller, Stuart Halloway, Aaron Bedra

Publisher Resources

ISBN: 9781617291418Supplemental ContentPublisher SupportOtherPublisher WebsiteSupplemental ContentPurchase Link