Welcome! Please see the About page for a little more info on how this works.

0 votes
in Spec by

{{s/form}} can unfn 1. } successfully in:

(s/form (s/and #(>= % 42))) ;=> (clojure.spec.alpha/and (clojure.core/fn [%] (clojure.core/>= % 42)))

But not in:

`
(s/form (s/and (s/and #(>= % 42))))
;=> (clojure.spec.alpha/and (clojure.spec.alpha/and (fn* [p1__1503#] (clojure.core/>= p1__1503# 42))))

; expected:
; (clojure.spec.alpha/and (clojure.spec.alpha/and (clojure.core/fn [%] (clojure.core/>= % 42))))
`

The same goes for 1. } forms occurring in any nested specs.

Cause: {{clojure.spec.alpha/res}} calls {{unfn}} only when it's applied directly to a form. So if a } form occurs in a nested spec form, {{c.s.a/res}} will do nothing and keep it as is.

2 Answers

0 votes
by

Comment made by: sohta

Added a patch.

0 votes
by
Reference: https://clojure.atlassian.net/browse/CLJ-2227 (reported by sohta)
...