Chapter 13Records and Protocols

One of the things that makes programming such a joyous challenge is that it’s full of trade-offs. One day you might find yourself choosing between making the program faster at the cost of a more complicated algorithm or a bit more memory. Twenty-four hours later you’re trying to strike a balance between ease of use and a more powerful interface. And by the third day you’re wrestling with the tension between building code that works decently everywhere versus a more specialized implementation that works better, but only right here.

It’s this last generic versus specialized question that we’re going to take up in this chapter as we look at Clojure records. In the pages that follow we’ll see how records are a more ...

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.