Search code examples
clojure

Clojure, reduce function. Error: Don't know how to create ISeq


When I executed this code

(reduce (fn [final number] (into final (+ number 1))) [] [1 2 3 4 5])

I got this error:

Don't know how to create ISeq from: java.lang.Long


Solution

  • You need conj instead of into.

    into appends a sequence, conj appends an element.