Fork me on GitHub
#clojure-spec
<
2018-09-01
>
spieden01:09:59

has anyone done anything with strictly validating some data against a spec? by this i mean not allowing anything other than what’s specified. e.g. extra map keys, etc.

seancorfield02:09:09

@spieden Several libraries have facilities for that and it's fairly easy to do. It's just not necessarily a good thing to do.

misha06:09:14

@spieden one example of such strict map validation would be s/map-of. if it specifies keywords-to-strings map - you can't have string key in there But, as Sean pointed out, it is kinda trivial to implement yourself with a particular shade of behavior you are looking for.

jeaye18:09:04

I've a repro for a bug where ClojureScript's spec instrument fn generates too large a function for the JVM and compilation fails. This happens when too many fns are spec'd. https://github.com/jeaye/instrument-too-many Looking for some confirmation.

andy.fingerhut22:09:59

It appears specific to ClojureScript. When I tried a similar thing in Clojure/JVM, there was no problem I noticed.

jeaye23:09:38

@andy.fingerhut Thanks. I've also tried it on Clojure JVM and I couldn't reproduce.