Last active
December 16, 2015 09:48
-
-
Save timmc/5415140 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 delayed | |
[p init] | |
(let [prev (atom init)] | |
(fn delayed-pred [& args] | |
(let [now (apply p args) | |
ret @prev] | |
(reset! prev now) | |
ret)))) | |
(take-while (delayed #(< % 200) true) [64 70 200 90]) | |
;; No, don't use this. It's silly. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment