Last active
December 20, 2015 12:39
-
-
Save robkuz/6132845 to your computer and use it in GitHub Desktop.
Some really bad play on words with clojure
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
| (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