Fork me on GitHub
#clojure-spec
<
2017-11-29
>
acron16:11:52

Re spec, should Clojure ensure that keys referenced in s/keys are registered? I just noticed an unregistered key in one of mine as was surprised I hadn't been made aware by the compiler

mpenet16:11:54

it allows that so that you can define key sets before the key specs themselves, most of the stuff in spec in wrapped in delays

mpenet16:11:22

I could be wrong, but this sounds like the "issue"

acron16:11:04

I understand, kinda makes sense.

acron16:11:48

Thanks @madstap this is useful

misha19:11:09

is there a good example of a generator, which generates map (record) where values of 2 fields are dependent? multispec solves opposite problem: conform/validate records with 2+ dependent fields, can it be leveraged for generating generator?

misha19:11:59

the nuance in a data model I have, is that :type key on record determines not presence/absence of an attribute, but shape of a particular attribute:

{:type :string :val "foo"}
;;vs.
{:type :media :val {:url "" :content-type"image/jpg"}}
so I am already jumping some hoops to create multispec for this (extra level of spec indirection between data shape and attribute name)

misha19:11:23

would like to avoid having custom monster generator, if possible at all