(ns clojure.examples.example
(:gen-class))
(defn example []
(def myatom (atom 1))
(println @myatom)
(compare-and-set! myatom 0 3)
(println @myatom)
(compare-and-set! myatom 1 3)
(println @myatom))
(example)
(ns clojure.examples.example
(:gen-class))
(defn example []
(def myatom (atom 1))
(println @myatom)
(compare-and-set! myatom 0 3)
(println @myatom)
(compare-and-set! myatom 1 3)
(println @myatom))
(example)