{{:pred}} 应在类似以下 explain 问题中解析
{{s/coll-of}} 和 {{s/every-kv}} 如果其值无效,应解析为 {{:pred}} 函数
(::s/problems (s/explain-data (s/coll-of (fn [x] (pos? x))) [-1]))
({:path [], :pred (fn [x] (pos? x)), :val -1, :via [], :in [0]})
应该是
(::s/problems (s/explain-data (s/coll-of (fn [x] (pos? x))) [-1]))
({:path [], :pred (clojure.core/fn [x] (clojure.core/pos? x)), :val -1, :via [], :in [0]})
其他示例
;; 与每个一样
(::s/problems (s/explain-data (s/every (fn [x] (pos? x))) [-1]))
({:path [], :pred (fn [x] (pos? x)), :val -1, :via [], :in [0]})
;; :distinct 选项 pred 未解析
(::s/problems (s/explain-data (s/coll-of pos? :distinct true) [-1 -1]))
[{:path [], :pred distinct?, :val [-1 -1], :via [], :in []}]
map-of 和 every-kv 没有这个问题。:count、:min-count、:max-count 和 :kind 选项正确地生成了解析后的 :preds。
*补丁:* clj-2168.patch