Fork me on GitHub
#clojure-spec
<
2021-01-13
>
mg16:01:36

It appears that closed spec checking doesn't work on select in spec2. Is this something deliberate?

Alex Miller (Clojure team)16:01:10

don't remember :) I think it should work? but could easily be buggy

mg16:01:50

Toy example:

(spec/def ::a string?)

(spec/def ::s (spec/schema [::a]))

(spec/valid? ::s {::a "hello" ::b "world"} {:closed #{::s}}) ;; => false

(spec/valid? (spec/select ::s [*]) {::a "hello" ::b "world"} {:closed #{::s}}) ;; => true

mg16:01:15

I read through the implementation of select and it looks like it doesn't do anything with :closed

Alex Miller (Clojure team)16:01:29

the things you "close" are schemas

Alex Miller (Clojure team)16:01:04

select has some pending rework to make it build more on top of schema

Alex Miller (Clojure team)16:01:19

when that's done it should start getting that effect

Alex Miller (Clojure team)16:01:44

so without thinking more, this is probably in the category of wip

mg16:01:37

Ok, thanks for the clarification! Sounds also like it would not be fruitful for me to submit a patch, also, so I'll wait on it

Alex Miller (Clojure team)16:01:23

nah, it's a non-trivial amount of work and bound into other things