Context
Clojure Agents are NOT sent new values. They are sent a function which is applied to the old value. In the initial days of programing, I found this counter intuitive, and often wrote code of the form:
(send some-atom (fn [old] new_value))
Then, gradually, I realized how awesome it was to send an update-function rather than a new value.
Question:
Where does this idea originally come from? What is sending update-function (instead of a new value) called? Is this idea part of a more general set of techniques for a different way to handle concurrency?
Thanks!
Rich Hickey refers to this as something like a functional time model in this video. To paraphrase; in traditional OO languages an identity is an object that goes from one state at time-1 to another at time-2 by locking the object, then editing the object so that it has effectively always been at in the state it is in at time-2, then unlocking it. You have to lock it to make sure nobody looks at it between states. In the baseball game example from that video this is akin to making everyone in the stadium close their eyes and clear their mind every time the ball moves. It’s worth the time to watch the original video.
the principal is that "the future is a function of the past"
an identity is a series of states and functions define the transitions between these states
ohh and to answer the original question Rich credits the idea to Alfred North Whitehead