do you really need that? How about an infinite lazy sequence? (defn infinite [arg] (lazy-seq (Thread/sleep 2000) ;;simulate 2 second retrieval time (concat (for [i (range 0 arg)] i) (infinite arg))))
(def a (infinite 3)) (first a) ;;=> sleep 2 seconds, return 0 (take 3 (filter #(= % 2) a)) ;;wait a bit and return 3 twos (loop [i 0 a (infinite 3)] ;;wait a bit, process 3 twos, and return "done" (cond (= i 3) "done" (= (first a) 2) (recur (+ i 1) (rest a)) true (recur i (rest a)))) -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en