Fork me on GitHub
ghadi03:09:01 A flexible generator facility, expressed functionally. Probably 80% of the way to yield. Examples at the bottom


It allows a lot of iterator like things to be written in a clear manner, so perhaps this of general interest. I'm curious to hear from people.


The produce! function is used in a completely different way in 2 arg and 3 arg version, yet it has the same name in the arglist. For me this is at least a very confusing interface, if not a poor design. I'd expected something simpler along the lines of how clojure.core.reducers/reduce handles the missing initial state.


Contrasting with c.c.reducers/reduce, the two arity version of this function doesn't have state it needs to discover for the initial call. This arity-2 variant here is explicitly stateful, like a #(.readLine rdr)