Re: On laziness and with-open

2009-07-09 Thread Sean Devlin
That pages says the scopes system is already designed. To you have any preliminary design docs posted somewhere? On Jul 9, 2:59 pm, Stuart Sierra wrote: > On Jul 9, 6:10 am, Mike wrote: > > > Is there a pattern out there in Clojure for handling laziness at the > > same time as handling resourc

Re: On laziness and with-open

2009-07-09 Thread Stuart Sierra
On Jul 9, 6:10 am, Mike wrote: > Is there a pattern out there in Clojure for handling laziness at the > same time as handling resource lifecycle (with-open, etc.)? Not yet, but it is planned, in something called "scopes." http://clojure.org/todo -SS --~--~-~--~~~--

Re: On laziness and with-open

2009-07-09 Thread B Smith-Mannschott
On Thu, Jul 9, 2009 at 16:43, eyeris wrote: > > I ran the code you pasted here. It didn't throw an IOException for me. > I am running 1.0. I suspect that You're Doing it Wrong. You'll see the exception only if you actually try to evaluate the lazy sequence returned by byte-seq. (import [java.io

Re: On laziness and with-open

2009-07-09 Thread eyeris
I ran the code you pasted here. It didn't throw an IOException for me. I am running 1.0. On Jul 9, 5:10 am, Mike wrote: > I wanted to grab bytes out of a stream, and didn't see an analogue to > reader from duck-streams, so I made my own: > > (defn byte-seq >   "Returns the bytes from stream as

Re: On laziness and with-open

2009-07-09 Thread Janico Greifenberg
Hi Mike, On Thu, Jul 9, 2009 at 12:10 PM, Mike wrote: > > I wanted to grab bytes out of a stream, and didn't see an analogue to > reader from duck-streams, so I made my own: > > (defn byte-seq >  "Returns the bytes from stream as a lazy sequence of ints. >  stream must implement java.io.InputStre

Re: On laziness and with-open

2009-07-09 Thread B Smith-Mannschott
On Thu, Jul 9, 2009 at 12:10, Mike wrote: > > I wanted to grab bytes out of a stream, and didn't see an analogue to > reader from duck-streams, so I made my own: > > (defn byte-seq >  "Returns the bytes from stream as a lazy sequence of ints. >  stream must implement java.io.InputStream." >  [#^ja