Re: Help: how to construct lazy sequences

2011-05-19 Thread timc
That was very helpful - thanks Meikel and Jonathon. -- 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.

Re: Help: how to construct lazy sequences

2011-05-19 Thread Jonathan Fischer Friberg
See the source of clojure.contrib.duck-streams/read-lines http://clojuredocs.org/clojure_contrib/clojure.contrib.duck-streams/read-lines For the second question: Use read-lines directly. If you want a lazy-seq that doesn't close the stream when it's empty, ; untested (defn take-bytes [rdr] (

Aw: Help: how to construct lazy sequences

2011-05-19 Thread Meikel Brandmeyer
Hi, how about this? (def sentence-spec {1 {:n 2 :fmt "[1] a=%d b=%d"} 4 {:n 0 :fmt "[4]"} 5 {:n 1 :fmt "[5] z=%d"}}) (defn input-reader [inputQ eof?] (fn [byteArray] (.put inputQ (or byteArray eof? (defn input-bytes [inputQ eof?] (->> (rep

Help: how to construct lazy sequences

2011-05-19 Thread timc
Hello I wonder if I could ask for advice on how to construct a lazy sequence. My application might be of interest to some of you. The context for this is that I have an embedded system with very limited facilities for proper debugging. I have inserted a 'trace' facility in the embedded code that