Created
February 2, 2015 23:30
-
-
Save pbalduino/bc5bfbd990d68b57b06a to your computer and use it in GitHub Desktop.
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 random-number [_] | |
| (rand-int 22)) | |
| (defn a-validate [valor] | |
| (> valor 10)) | |
| (defn a-errorhandler [ag ex] | |
| (println "Error: " (.getMessage ex))) | |
| (defn a-watcher [ref chave antigo novo] | |
| (println "Watching:" ref chave antigo novo)) | |
| (def a (agent 11 :validator a-validate :error-handler a-errorhandler :error-mode :fail)) | |
| (add-watch a :watcher-1 a-watcher) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment