评论者:pbrown
我发现另一个额外的嵌套情况,当在一个可选的项目开始或结束时重复一个或多个序列,且该元素的谓词也与另一个端的项目相匹配时。
user=> (s/conform (s/+ (s/cat :k any? :v (s/? any?))) [:a 1 :b 2]) [{:k :a, :v 1} [{:k :b, :v 2}]]
我预期
`
[{:k :a, :v 1} {:k :b, :v 2}] `
以下给出预期的结果
user=> (s/conform (s/+ (s/cat :k any? :v (s/? any?))) [:a 1 :b]) [{:k :a, :v 1} {:k :b}] user=> (s/conform (s/+ (s/cat :k keyword? :v (s/? int?))) [:a 1 :b 2]) [{:k :a, :v 1} {:k :b, :v 2}] user=> (s/conform (s/* (s/cat :k any? :v (s/? any?))) [:a 1 :b 2]) [{:k :a, :v 1} {:k :b, :v 2}]