I am learning Clojure, and actually I am doing some exercises, but I am stuck in a problem:
I need to make a function sum-consecutivesthat sums up consecutive elements in an array, resulting in a new example:
[1,4,4,4,0,4,3,3,1]
I made this function that should work fine:
(defn sum-consecutives [a]
(reduce
But this causes an error:
IllegalArgumentException I do not know how to create an ISeq from: java.lang.Long clojure.lang.RT.seqFrom (RT.javaβΊ42)
Can someone help me figure out what's wrong with my func? I have already searched for this error on the Internet, but have not found any useful solutions.
source
share