Re: How do I detect the end of a file without catching an exception?

2014-04-07 Thread Simon Brooke
OK, the second question I've sort of answered for myself, by riffing on the source of line-seq: (defn expr-seq Returns forms from src (assumed to be Clojure source) as a lazy sequence of expressions [^java.io.PushbackReader src] (when-let [expr (read src)] (try (cons expr

Re: How do I detect the end of a file without catching an exception?

2014-04-07 Thread guns
On Mon 7 Apr 2014 at 11:07:37AM -0700, Simon Brooke wrote: OK, the second question I've sort of answered for myself, by riffing on the source of line-seq: (defn expr-seq Returns forms from src (assumed to be Clojure source) as a lazy sequence of expressions [^java.io.PushbackReader

Re: How do I detect the end of a file without catching an exception?

2014-04-07 Thread A. Webb
On Monday, April 7, 2014 1:14:40 PM UTC-5, guns wrote: On Mon 7 Apr 2014 at 11:07:37AM -0700, Simon Brooke wrote: OK, the second question I've sort of answered for myself, by riffing on the source of line-seq: (defn expr-seq Returns forms from src (assumed to be Clojure

Re: How do I detect the end of a file without catching an exception?

2014-04-07 Thread Simon Brooke
Thank you, that's neat! On Monday, 7 April 2014 19:14:40 UTC+1, guns wrote: On Mon 7 Apr 2014 at 11:07:37AM -0700, Simon Brooke wrote: OK, the second question I've sort of answered for myself, by riffing on the source of line-seq: (defn expr-seq Returns forms from src