"Computes a lazy-seq in another (dedicated) thread."
(let [ex (. java.util.concurrent.Executors newSingleThreadExecutor)]
((fn this [s]
(let [future-rest (java.util.concurrent.FutureTask. #(rest s))]
(.execute ex future-rest)
(lazy-cons (first s) (this (.get future-rest))))
(.shutdown ex))) s)))
Monday, June 23, 2008
This post has moved, go to its new location
If you can't put off what you have to do, ask someone else to do it for you.