Fork me on GitHub
#clojure-spec
<
2016-09-25
>
misha00:09:25

however in clojure it works:

(s/explain-data :foo/bar #(identity {}))
=> #:clojure.spec{:problems [{:path [], :pred (apply fn), :val (0 :A), :reason "Wrong number of args (2) passed to: sandbox/eval7829/fn--7830", :via [:foo/bar], :in []}]}

Oliver George05:09:25

Anyone here use devcards? I'm experimenting with how cards could be initialised based on spec/gen data. Would love any opinions/insights. Ticket: https://github.com/bhauman/devcards/issues/112 and gist https://gist.github.com/olivergeorge/82a20dd03fd86e82ab9b0f3959590f3f

Oliver George05:09:25

Perhaps my use case is special but it seems like something which might be useful to others.

Oliver George05:09:20

The other fiddly bit was working with the function sym. I needed to resolve the sym to the current local var value but also keep the sym to call (s/get-spec ...). In the end I used (var). Not sure if there's downsides to that I'm missing.

Oliver George10:09:26

I think that was my inspiration. I've added a bit more finessing about showing interesting random data (overrides) and controls (seed & size) which might make for a more useful UI dev tool.

Oliver George10:09:23

Needs some helper generators. I never leave home without my lorem ipsum generator.