This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-09-25
Channels
- # bangalore-clj (1)
- # beginners (13)
- # boot (163)
- # cljsrn (23)
- # clojure (70)
- # clojure-czech (1)
- # clojure-russia (6)
- # clojure-spec (8)
- # clojurescript (47)
- # cloverage (16)
- # cursive (2)
- # editors (1)
- # garden (2)
- # lein-figwheel (1)
- # om (30)
- # om-next (2)
- # perun (2)
- # planck (23)
- # rdf (4)
- # reagent (1)
- # specter (2)
- # untangled (8)
- # vim (7)
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 []}]}
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
Perhaps my use case is special but it seems like something which might be useful to others.
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.
@olivergeorge it’s been done before 🙂 https://juxt.pro/blog/posts/generative-ui-clojure-spec.html
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.
Needs some helper generators. I never leave home without my lorem ipsum generator.