Reputation: 160
(def text1 "qwwqer qwasdfas")
(defn countL [text char] (reduce 0
#(if (= %2 char) (+ %1 1) (+ %1 0))
text)
)
(println (countL text1 "q"))
I write this code and recive this error, but I not understand why? Please explain to me.
Upvotes: 0
Views: 287
Reputation: 1589
The argument order for reduce is incorrect. See https://clojuredocs.org/clojure.core/reduce
Upvotes: 3