O'Reilly logo

Functional Programming: A PragPub Anthology by Michael Swaine

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The Clojure Model

Clojure provides a different model. To explain it, let’s revisit the terms value, state, and identity and give them definitions that might be a bit different from the ones you’re used to.

In Clojure’s world, a value is an immutable piece of data, or a composite of immutable pieces of data. This differs from what we might consider a value in most object-oriented languages, where we’d consider both immutable data, such as integers and strings, and mutable data, such as most objects, to be values.

Next up is the notion of an identity. An identity is an entity that’s associated with a series of values over time. An identity is not a place, like a mutable memory cell, or the mutable objects we saw earlier. Neither is an identity ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required