Re: 4clojure count problem

2015-10-04 Thread Roelof Wobben
Thanks, This solbved my problem. Roelof Op zondag 4 oktober 2015 11:51:49 UTC+2 schreef Moe Aboulkheir: > > Roelof, > > The function you're passing to reduce still wants to accept two > arguments. See the documentation: > https://clojuredocs.org/clojure.core/reduce > > Take care, > Moe > > O

Re: 4clojure count problem

2015-10-04 Thread Moe Aboulkheir
Roelof, The function you're passing to reduce still wants to accept two arguments. See the documentation: https://clojuredocs.org/clojure.core/reduce Take care, Moe On Sun, Oct 4, 2015 at 8:40 AM, Roelof Wobben wrote: > Oke, then I hve to find out where to put the initial value. > > These two

Re: 4clojure count problem

2015-10-04 Thread Roelof Wobben
Oke, then I hve to find out where to put the initial value. These two do not work : (reduce (fn [counter] (inc counter)) 0 [1,2,3]) (reduce (fn [counter] (inc counter) 0 ) [1,2,3]) Op zaterdag 3 oktober 2015 23:34:20 UTC+2 schreef Moe Aboulkheir: > > Roelof, > > Unless supplied with an init

Re: 4clojure count problem

2015-10-03 Thread Moe Aboulkheir
Roelof, Unless supplied with an initial value, reduce will use the first value from the collection you supply - every sequence which doesn't start with "1" will give you the wrong answer. Take care, Moe On Sat, Oct 3, 2015 at 9:40 PM, Roelof Wobben wrote: > Hello, > > I have to make a function

Re: 4clojure count problem

2015-10-03 Thread Michael Blume
Reduce can take either two or three arguments; when it takes two arguments, it makes some assumptions about the argument that was left out. You're using reduce with two arguments, so you might want to rethink those assumptions. On Sat, Oct 3, 2015 at 2:19 PM Roelof Wobben wrote: > Hello, > > I h