应将{{: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]})
其他示例
;; 与every相同
(::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