Re: reduce, reduce-kv, map, mapv, reducers/map and nil

2013-01-07 Thread Alan Busby
On Tue, Jan 8, 2013 at 12:18 AM, Wolodja Wentland wrote: > On Thu, Nov 01, 2012 at 22:34 +0900, Alan Busby wrote: > > On Thu, Nov 1, 2012 at 8:27 PM, Wolodja Wentland > wrote: > > > > Oh, fold-into-map and fold-into-map-with would be wonderful and I > tried to > > > implement the former along th

Re: reduce, reduce-kv, map, mapv, reducers/map and nil

2013-01-07 Thread Wolodja Wentland
On Thu, Nov 01, 2012 at 22:34 +0900, Alan Busby wrote: > On Thu, Nov 1, 2012 at 8:27 PM, Wolodja Wentland wrote: > > Oh, fold-into-map and fold-into-map-with would be wonderful and I tried to > > implement the former along the lines of fold-into-vec, but the performance > > was > > abysmal. I am

Re: reduce, reduce-kv, map, mapv, reducers/map and nil

2012-11-01 Thread Alan Busby
On Thu, Nov 1, 2012 at 8:27 PM, Wolodja Wentland wrote: > It seems to me as if we are currently figuring out which (boilerplate?) > functions are missing in reducers.clj and that we will have a nice and > well-integrated library at the end. To be fair, it's in beta and it's open source; so if any

Re: reduce, reduce-kv, map, mapv, reducers/map and nil

2012-11-01 Thread Wolodja Wentland
On Thu, Nov 01, 2012 at 15:11 +0900, Alan Busby wrote: > On Mon, Oct 29, 2012 at 10:00 PM, Wolodja Wentland wrote: > > I find this behaviour quite unfortunate because I now have to explicitly > > test > > for nil? and ensure consistent behaviour. This inconsistency violates the > > principle of l

Re: reduce, reduce-kv, map, mapv, reducers/map and nil

2012-10-31 Thread Alan Busby
On Mon, Oct 29, 2012 at 10:00 PM, Wolodja Wentland wrote: > I find this behaviour quite unfortunate because I now have to explicitly test > for nil? and ensure consistent behaviour. This inconsistency violates the > principle of least-surprise and I am not sure if the current behaviour is > intent

Re: reduce, reduce-kv, map, mapv, reducers/map and nil

2012-10-31 Thread Herwig Hochleitner
Created an issue: http://dev.clojure.org/jira/browse/CLJ-1098 Don't know if patch is welcome, but fix should be trivial, so not much is lost if declined. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@goo

Re: reduce, reduce-kv, map, mapv, reducers/map and nil

2012-10-31 Thread Wolodja Wentland
On Tue, Oct 30, 2012 at 15:17 +0100, Herwig Hochleitner wrote: >I've also run into this. Maybe this is just an oversight, since clojure >handles nils gracefully almost everywhere else. >Should CollFold and IKVReduce be extended to nil, or is there some >rationale against it? I woul

Re: reduce, reduce-kv, map, mapv, reducers/map and nil

2012-10-30 Thread Herwig Hochleitner
I've also run into this. Maybe this is just an oversight, since clojure handles nils gracefully almost everywhere else. Should CollFold and IKVReduce be extended to nil, or is there some rationale against it? -- You received this message because you are subscribed to the Google Groups "Clojure"

Re: reduce, reduce-kv, map, mapv, reducers/map and nil

2012-10-30 Thread abp
> > I find this behaviour quite unfortunate because I now have to explicitly > test > for nil? and ensure consistent behaviour. Yes, especially unfortunate considering that Rich said the reducers lib could be used as a drop in replacement for core to speed up programs, or something along the

reduce, reduce-kv, map, mapv, reducers/map and nil

2012-10-29 Thread Wolodja Wentland
Hi all, I am currently testing performance of different reduce and map implementations in my programs and have problems because their treatment of nil is different. The "normal" clojure.core implementations of reduce and map work well when called on nil, but reduce-kv and functions in clojure.redu