Fork me on GitHub

Do you know an explanation of epochal time model? And how do clojure state primitives make time a first class object? I will rewatch are we there yet.


continuous time - changes just happen, you might hit "before change, during change, after change". epochal time - there is no "during change". Either you are before the change, or after the change. Example application of epochal time: atom. when you deref an atom, you either get the value before the change, or the value after the change. You don't get a partially applied change (which is often an invalid state) Other examples of epocal time are #datascript, #datomic and #xtdb.

👍 3
Ivar Refsdal12:06:12

Expanding on this: you might want to check out [swap-vals!](!) if you don't know about it already. it's like swap!, except returns both the old and new value, so if your swap function does something maybe, you can compare old and new after the swap to see if it did in fact do something. (a deref and then swap!/reset! can lead to a race condition) I'm using it here for example:

Ivar Refsdal12:06:49

why didn't the swap-vals! link work... because of !?


I normally copy a url, select the link text and press C-v which turns it into a link. Not sure to what extent markdown is supported.