(def text1 "qwwqer qwasdfas")
(defn countL [text char] (reduce 0
#(if (= %2 char) (+ %1 1) (+ %1 0))
text)
)
(println (countL text1 "q"))
我写了这段代码并收到了这个错误,但我不明白为什么?请给我解释一下。
reduce 的参数顺序不正确。请参阅https://clojuredocs.org/clojure.core/reduce
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句