Created
June 11, 2013 11:05
-
-
Save matko/5756075 to your computer and use it in GitHub Desktop.
function generator that converts a sequence to a fragmented and timed lazy seq, with parameters alterable after seq construction.
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 generate-configured-timed-lazy-seq-fn [delay fragment-size] | |
(fn blah [c] | |
(if (seq c) | |
(lazy-seq | |
(let [delay @delay | |
fragment-size @fragment-size] | |
(Thread/sleep delay) | |
(cons | |
(take fragment-size c) | |
(blah (nthrest c fragment-size)))))))) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment