Wrapping Up

When building an application, we often find ourselves carrying updates forward through an otherwise pure application. If we’re clear about the rules, are responsible with our functions, and make good choices about what we need to manage, we can do it effectively.

Viewing your data and its changing state as a series of snapshots allows you to act responsibly when considering the presence of observers in other processes. In Clojure, those snapshots are kept as previous versions wrapped up in mutable references. This ensures that all observers have a consistent set of values as of a particular instant, and no one finds themselves in unfortunate circumstances.

We started this chapter by exploring the ideas about identity and state in ...

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