Fork me on GitHub

is it unavoidable to have separate spec/alt and spec/or? why can't we use spec/or as regex op?


same with spec/& and spec/and


same with spec/keys* and spec/keys


there is already a way to escape "regex context" by using spec/spec, it would be nice to have slimmer api..


hmm, actually, both spec/or and spec/alt work in regex context

Alex Miller (Clojure team)12:08:28

They are not the same in a regex context

Alex Miller (Clojure team)12:08:33

If you have another regex underneath the alt it can combine with regexes above in ways that or cannot

Alex Miller (Clojure team)12:08:17

So yes, they are both needed


it just feels they could be semantically the same

Alex Miller (Clojure team)13:08:58

they are semantically different

Alex Miller (Clojure team)13:08:23

just as s/coll-of and s/* are semantically different


what is the difference in their semantics?

Alex Miller (Clojure team)13:08:56

regexes combine to describe the structure of a single collection. non-regexes do not.


it feels like with regexes and s/spec "escaping" there is no need in coll-of/and/or?


you can express the same things

Alex Miller (Clojure team)13:08:23

specs are intended to express meaning to the reader and these have different meanings

Alex Miller (Clojure team)13:08:55

whether you can turn the crank on two things and get the same answer is to some degree beside the point


I think I understand

Alex Miller (Clojure team)13:08:18

they are completely different implementations and likely have very different perf characteristics in validation

Alex Miller (Clojure team)13:08:31

also need to consider generation, etc


yeah, right