History of Clojure Agent Model

Context

Clojure Agents DO NOT post new values. They are sent a function that applies to the old value. In the early days of programming, I found this counter intuitive and often wrote form code:

(send some-atom (fn [old] new_value)) 

Then, gradually, I realized how amazing it was to send an update function, not a new value.

Question:

Where did this idea come from? What is the update function (instead of the new value)? Is this idea part of a more general set of methods for another way to handle concurrency?

Thanks!

+4
source share
1 answer

Rich Hickey refers to this as a functional time model in this video . Rephrase in traditional OO languages, identification is an object that moves from one state at a time from 1 to another at time-2, locking the object and then editing the object so that it is always in the state it is in, 2, then open his. You must block it so that no one is looking at it between states. In the baseball game example from this video, itโ€™s akin to everyone in the stadium turning a blind eye and clearing their minds every time the ball moves. It is worth watching the original video.

the principle is that "the future is a function of the past"

identity is a series of states and functions that determine the transitions between these states

ohh and answer the original question. Rich conveys the idea to Alfred North Whitehead.

+2
source

All Articles