Fork me on GitHub
#clojure-spec
<
2019-11-22
>
jaihindhreddy06:11:05

My 2c is that: this is trying to do too much with spec. I'd keep the tags simple keywords, and do the manipulation later, using spec only to suss out the implicit ordering or types into explicit data (via cat and or respectively).

sgerguri09:11:43

I'm always torn between that and doing more. Spec feels like it's one step away from automatic transformations, with conformers being the key enabling element for this.

jaihindhreddy10:11:44

I can sympathise 100%

jaihindhreddy10:11:23

But spec's neither a kitchen sink, nor a silver bullet 😀

sgerguri11:11:57

I think if specs supported metadata one could use simple tags and just indicate code-level stuff there. Perhaps we'll get that functionality in version 2.

1
jaihindhreddy11:11:34

I dunno if spec wants to do that. Because the awesome thing in Clojure is that, we already have namespaced keywords, which are (when correctly used) globally precise names. And this means just like spec maintains a global registry of specs attached to these names for the purpose of specification, we can write our own things which maintain global registries of other stuff attached to the same names, for use in other contexts. I think this is one of those instances where making things global makes sense, and alleviates parochiality. For this kind of a thing to be realistic though, I feel like the idea of providing and requiring contexts needs to be first class and written down in code, so that automatic verification of breakage can be detected and avoided, making way for an ecosystem that can integrate various things seamlessly while still being dynamic and "growable"

alexmiller13:11:22

conform is designed to tell you why something was validated and separate data into parsed components

alexmiller14:11:59

It is not a general “data transform meat grinder” and you’ll be disappointed if you try to use it that way

💯 1
👍 2