Created
June 24, 2020 13:05
-
-
Save kwrooijen/c209c4d2317ce9ab4f7c39863f94099c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(deftype YggdrasilAtom [name state] | |
clojure.lang.IAtom | |
(reset [this f] (reset! (.-state this) f)) | |
(swap [this a] (swap! (.-state this) a)) | |
(swap [this a b] (swap! (.-state this) a b)) | |
(swap [this a b c] (swap! (.-state this) a b c)) | |
(swap [this a b c d] (swap! (.-state this) a b c d)) | |
(compareAndSet [this a b] (compare-and-set! (.-state this) a b)) | |
(toString [this] (str (.-name this))) | |
clojure.lang.IDeref | |
(deref [this] (deref (.-state this)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment