Fork me on GitHub
#off-topic
<
2022-06-27
>
Benjamin11:06:08

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.

teodorlu12:06:50

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!](https://clojuredocs.org/clojure.core/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: https://github.com/ivarref/mikkmokk-proxy/blob/0afe32ab7cbb6a7c3f8e56bd3849ceb14a7bbe24/src/com/github/ivarref/mikkmokk_proxy.clj#L237

Ivar Refsdal12:06:49

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

teodorlu12:07:10

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.