Wrapping Up

In this chapter we looked at destructuring. Clojure is full of deep, interesting ideas, things like programming with immutable data structures and lazy sequences. Destructuring isn’t one of them. Destructuring makes up for its lack of deep philosophical implications by being a practical, clever alternative to picking through your data one API call at a time. Instead of all that first-ing and nth-ing your way through a data structure, destructuring lets you build a sort of treasure map of the data that you want. Start in the first slot of this sequence, then turn right at this keyword and go 20 paces down that vector.

Next, and continuing with the dealing with your data theme, we’re going to turn to records, which are like maps that ...

Get Getting Clojure 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.