On Wed, Aug 22, 2012 at 10:48:03AM +0100, nicolas.o...@gmail.com wrote: > > In particular, if I attempt to replace the `r/reduce` call on line #23, > > with a call to `r/fold`, I get the following crash: > > > This calss sems strange. > remaining? should represent a monoid for it to work. > > Meaning two functions: > 1 -> A and (A -> A -> A) > > In your code, the case with no arg returns a boolean, and the function > in the other branch wait > for a boolean and a number.
You're likely right, but currently my code doesn't even get to "remaining?" (i.e. if I put a log line in the method, it never gets logged). Actually, this is a different issue, but my reading of the reducers library is that I could use "remaining?" as is for the reducef and a separate function for the combinef, and only combinef needs to be a proper monoid. Is that right? Also, on a related note, it's very annoying that "and" in Clojure is implemented as a macro and therefore cannot be used directly as combinef... - Josh -- Joshua Ballanco ELC Technologies™ 1771 NW Pettygrove Street, Suite 140 Portland, OR, 97209 jballa...@elctech.com P +1 866.863.7365 F +1 877.658.6313 M +1 646.463.2673 T +90 533.085.5773 http://www.elctech.com -- 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