Created
April 22, 2013 14:05
-
-
Save houshuang/5435378 to your computer and use it in GitHub Desktop.
Trying, trying
This file contains 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 do-on-change [func files] | |
(let [old (atom (map-current files))] | |
(while true | |
(do | |
(Thread/sleep 500) | |
(let [current (atom (map-current files))] | |
(println "hi") | |
(if (hash-diff @old @current) | |
(do | |
(func) | |
(swap! old @current)))))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment