Skip to content

Commit

Permalink
edit copy
Browse files Browse the repository at this point in the history
  • Loading branch information
Mario T. Lanza committed May 28, 2024
1 parent e867c88 commit 4ef2e36
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion adopting-the-clojure-mindset.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Immutable `assoc` is tailor-made for truly persistent types, like records. But

The same applies to `conj` or any other command one imagines. It's possible to simulate change against any type. All simulation requires is an atom or, in Atomic, a cell. The cell contains the state and [`swap`](https://clojuredocs.org/clojure.core/swap!)s updates against it using simulated commands.

What this effectively means is the above table can, as desired, be fully realized so that any mutable operation can also be simulated, written as reductive operations. What this reaveals is all programs are, at their very centers, [reductions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce).
What this effectively means is the above table can, as desired, be fully realized so that any mutable operation can also be simulated, written as a reductive operation. What this reaveals is all programs are, at their very centers, [reductions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce).

That's the cornerstone of how Clojure models state change. And where Clojure actually has a robust set of persistent types, JavaScript doesn't. So Atomic uses reference types and pure protocols/functions to emulate persistent types. In practice, this proves performant enough to be of little concern.

Expand Down

0 comments on commit 4ef2e36

Please sign in to comment.