(ns clojure.examples.example (:gen-class)) (defn Example [] (def counter (ref 0)) (defn change [counter] (dosync (commute counter inc))) (change counter) (println @counter) (change counter) (println @counter)) (Example)
We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy. Accept Learn more