clojure-dev

Issues: https://clojure.atlassian.net/browse/CLJ | Guide: https://insideclojure.org/2015/05/01/contributing-clojure/
vlaaad 2019-08-29T07:39:30.001500Z

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

vlaaad 2019-08-29T07:40:15.001800Z

same with spec/& and spec/and

vlaaad 2019-08-29T07:41:17.002200Z

same with spec/keys* and spec/keys

vlaaad 2019-08-29T07:41:49.002900Z

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

vlaaad 2019-08-29T07:45:52.003500Z

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

alexmiller 2019-08-29T12:57:28.004200Z

They are not the same in a regex context

alexmiller 2019-08-29T12:58:33.005800Z

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

alexmiller 2019-08-29T12:59:17.006600Z

So yes, they are both needed

vlaaad 2019-08-29T13:17:15.006900Z

ah, I see

vlaaad 2019-08-29T13:17:32.007200Z

it just feels they could be semantically the same

alexmiller 2019-08-29T13:30:58.007500Z

they are semantically different

alexmiller 2019-08-29T13:31:23.007900Z

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

alexmiller 2019-08-29T13:31:42.008100Z

and s/and / s/&

vlaaad 2019-08-29T13:36:27.008900Z

what is the difference in their semantics?

alexmiller 2019-08-29T13:37:56.009600Z

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

vlaaad 2019-08-29T13:40:10.010400Z

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

vlaaad 2019-08-29T13:40:48.011100Z

you can express the same things

vlaaad 2019-08-29T13:40:49.011400Z

no?

alexmiller 2019-08-29T13:41:23.012Z

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

alexmiller 2019-08-29T13:41:55.012700Z

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

vlaaad 2019-08-29T13:42:08.012900Z

I think I understand

alexmiller 2019-08-29T13:42:18.013400Z

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

alexmiller 2019-08-29T13:42:31.013800Z

also need to consider generation, etc

vlaaad 2019-08-29T13:43:13.014Z

yeah, right