Created
November 10, 2012 03:22
-
-
Save cmeiklejohn/4049721 to your computer and use it in GitHub Desktop.
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 threshold | |
([thr call-fn] | |
#(threshold thr 1 call-fn)) | |
([thr cur call-fn] | |
(if (> cur thr) | |
(do (apply call-fn []) | |
#(threshold thr call-fn)) | |
#(threshold thr (inc cur) call-fn)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment