Mongodb is storing data as json. So you probably need to have some sort of convention how to encode qualified keywords to/from json
a bit surprising:
(s/valid? (s/map-of keyword? int? :kind vector?) [[:a 1]])
=> true
what is that even supposed to mean?
seems like it's doing exactly what the docstring says to me
I don't know what that's supposed to mean, I'm trying to build a tool on top of spec and I have to support what it supports
I'll probably ignore this particular thing... I just was trying to understand what kind of data shapes various variations of s/every
support.
spec needs a spec? ;)
less surprising:
(s/valid? (s/every-kv keyword? int?) #{[:a 1]})
=> true
every-kv
docstring states it works on associative collections...what kind of tool are you building, or is it secret?
"spec forms"
something cljfx related?
It's a reveal plugin that builds a UI form for a given spec. Then you can fill the form to get back the data in the shape that satisfies the spec.
...and the form resembles the data
so it's way to visualize a spec form?
More than that. You can bind changes in form to custom code and custom views. For example, if you have spec for vega/vega-lite data format, you can have a UI form for creating vega chart input and a vega chart itself that updates on changes to the form. This allows learning and experimenting with data-driven APIs interactively
every-kv is really about "seqs to map entries", but we have no way to say that in Clojure (yet)
Rich and I have been talking about that gap for years, some day we'll figure it out :)
what's the 2-version of triple?
duple?
map-entry?
pair is commonly used though :)
duple-blob
duple-flock
solved? ;)
the "seqs to" part is the hard part :)
btw I think every-kv is fine, I'd expect it to accept any coll
but maybe the docstring shouldn't mention associative...
I think that may be vestigial from earlier impls