Skip to content

Instantly share code, notes, and snippets.

View jellelicht's full-sized avatar

Jelle Licht jellelicht

  • Refaktoro
  • the Netherlands
View GitHub Profile
@matko
matko / gist:5756075
Created June 11, 2013 11:05
function generator that converts a sequence to a fragmented and timed lazy seq, with parameters alterable after seq construction.
(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))))))))