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
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
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
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
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