Skip to content

Instantly share code, notes, and snippets.

@robkuz
Last active December 20, 2015 12:39
Show Gist options
  • Select an option

  • Save robkuz/6132845 to your computer and use it in GitHub Desktop.

Select an option

Save robkuz/6132845 to your computer and use it in GitHub Desktop.
Some really bad play on words with clojure
(defn even-or-odd []
(let [x (atom 1)]
(fn []
(cond
(even? @x) (println "I am even")
(odd? @x) (println "I am odd"))
(swap! x inc))))
(def I-am-even-odder (even-or-odd))
(I-am-even-odder)
(I-am-even-odder)
(I-am-even-odder)
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment