Closed ertugrulcetin closed 3 years ago
Hi, I'm getting No implementation of method: :kv-reduce of protocol: #'clojure.core.protocols/IKVReduce found for class: clojure.lang.LazySeq error.
No implementation of method: :kv-reduce of protocol: #'clojure.core.protocols/IKVReduce found for class: clojure.lang.LazySeq
Here is my code;
(def MAP-NODES (s/recursive-path [] p (s/cond-path sequential? (s/continue-then-stay s/MAP-VALS p) map? (s/continue-then-stay s/MAP-VALS p))))
Here is my fn:
(defn trim-titles [data] (s/transform [MAP-NODES #(and (map? %) (:title %)) :title] str/trim data))
data is a huge deeply nested data structure.
data
Small sample from the data;
.... {:title "COV_SYMPTOMS_ANOSMIE?", :id "06ecdd34-1e9d-48e5-b913-ed93a1677102", :children {:attached [{:id "bf1f0a4a-5f16-48bf-9fcb-f2930cdd354b", :title "YES", :children {:attached [{:title "LANGUAGE?", :id "39c61696-3037-4247-8b70-5b7180caa5f5", children {:attached [{:title "EN", :id "08c8f077-b1ce-4b38-8f53-1faa4dc0cd64", ...
Looks like you meant to use ALL on sequential? branch instead of MAP-VALS.
ALL
sequential?
MAP-VALS
@nathanmarz thanks, my mistake
Hi, I'm getting
No implementation of method: :kv-reduce of protocol: #'clojure.core.protocols/IKVReduce found for class: clojure.lang.LazySeq
error.Here is my code;
Here is my fn:
data
is a huge deeply nested data structure.Small sample from the data;