Hacker News new | ask | show | jobs
by vlmutolo 656 days ago
> The whole game state is stored in one atom: app/state and entities are again atoms inside the main atom (like in our universe).

I don’t know clojure. Is this normal terminology, ie to use “atom” this way? Seems like a bad name for the concept since the whole idea of “atoms” is that they’re indivisible (back when physics thought they were indivisible).

2 comments

They're called atoms because operations on them are atomic, I think.
Atomic types appear in Java as well, this looks very much like an AtomicReference from a distance: https://clojure.org/reference/atoms