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
They are not the same in a regex context
If you have another regex underneath the alt it can combine with regexes above in ways that or cannot
So yes, they are both needed
ah, I see
it just feels they could be semantically the same
they are semantically different
just as s/coll-of and s/* are semantically different
and s/and / s/&
what is the difference in their semantics?
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
no?
specs are intended to express meaning to the reader and these have different meanings
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
they are completely different implementations and likely have very different perf characteristics in validation
also need to consider generation, etc
yeah, right