This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-03-21
Channels
- # beginners (65)
- # boot (24)
- # cider (2)
- # clara (13)
- # cljs-dev (45)
- # clojure (48)
- # clojure-dusseldorf (2)
- # clojure-italy (69)
- # clojure-norway (1)
- # clojure-russia (5)
- # clojure-sanfrancisco (1)
- # clojure-spec (51)
- # clojure-uk (34)
- # clojurescript (312)
- # cursive (5)
- # datavis (1)
- # datomic (9)
- # duct (13)
- # editors (3)
- # emacs (2)
- # fulcro (11)
- # graphql (19)
- # hoplon (1)
- # immutant (2)
- # jobs (7)
- # jobs-discuss (38)
- # lein-figwheel (1)
- # luminus (6)
- # off-topic (2)
- # parinfer (10)
- # pedestal (1)
- # re-frame (9)
- # reagent (28)
- # reitit (1)
- # remote-jobs (12)
- # ring-swagger (26)
- # shadow-cljs (232)
- # slack-help (8)
- # tools-deps (29)
- # unrepl (29)
- # vim (10)
- # yada (31)
@alexmiller sorry, meaning that spec would, e.g., require test.check >= 0.10.0
you made a comment a few weeks back that implied that wouldn't be acceptable
@misha 🙂 Thanks. Im just concerned about the name explosion when composing up the tree
@gfredericks I wouldn’t make a range version but we could certainly bump the requirement
the difference between those two things is whether a max version is specified?
I just don’t like version ranges
No one likes version ranges 🙂
The only people that like version ranges are people that haven’t used them :)
đź‘Ť thanks
I'm looking to do some visualization of specs and by default would think using the reader would be the most straight forward way to consume/read the specs. Is there a better way? A library perhaps that produces a higher level representation? Thoughts?
@kahunamoore I have not used this tool, and not sure if it is what you are looking for, but it sounds at least related: https://github.com/jebberjeb/specviz
Learned about it from Stuart Halloway's talk "REPL driven development": https://github.com/matthiasn/talk-transcripts/blob/master/Halloway_Stuart/REPLDrivenDevelopment.md
yesterday I helped a coworker spec some financial calc functions, then we immediately found some bugs by check
ing them đź‘Ź
aside: will the default generator for number?
predicate generate all/most numeric types (like ratios)?
Would it make sense if Spec could aid in producing human readable errors? https://gist.github.com/borkdude/89799a764a89af5c0be1a5745be58b4d
what problem are you trying to solve?
I output form-controllers based on the type of a specification. So for simple spec definitions like (spec/def ::placeholder string?)
I can output a textfield because I know it’s a string with (type the-def)
, but for definitions that use with-gen
; type
returns nil
@hkjels Can you talk more about how you determine the type in the simple case? Are you inspecting the spec itself, or an example generated value?
he’s returning (constantly nil)
, which is a function
I feel like you should still be driving from the spec, not the generator
(you should also be using ifn?
, not fn?
btw)
Agreed, @hkjels if I were trying to generate forms based on the spec, I’d look at introspecting the specs using s/form
. Obviously it’s be hard with all possible specs
but if you have a subset of forms in your app, you could reasonably inspect them and generate the cases that interest you
well in this case, s/form doesn’t currently work on predicates
you could use spec specs for that :) (CLJ-2112)
@andy.fingerhut Thanks! I remember reading/hearing about it but Google failed me - too many spec tutorials, docs and other misses.
@hkjels would (spec/* (s/alt string? ::hiccup))
work?
Need to label the branches @gfredericks ^
yeah that sounds truthful