Created
February 6, 2014 06:00
-
-
Save sgithens/8839010 to your computer and use it in GitHub Desktop.
This file contains 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
(def atomic-clock (atom 0)) | |
(meditations | |
"Atoms are like refs" | |
(= 0 @atomic-clock) | |
"You can change at the swap meet" | |
(= 1 (do | |
(swap! atomic-clock inc) | |
@atomic-clock)) | |
"Keep taxes out of this: swapping requires no transaction" | |
(= 5 (do | |
__ | |
@atomic-clock)) | |
"Any number of arguments might happen during a swap" | |
(= __ (do | |
(swap! atomic-clock + 1 2 3 4 5) | |
@atomic-clock)) | |
"Atomic atoms are atomic" | |
(= __ (do | |
(compare-and-set! atomic-clock 100 :fin) | |
@atomic-clock)) | |
"When your expectations are aligned with reality things, proceed that way" | |
(= :fin (do | |
(compare-and-set! __ __ __) | |
@atomic-clock))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment