This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-08-17
Channels
- # admin-announcements (1)
- # aleph (1)
- # architecture (1)
- # bangalore-clj (14)
- # beginners (15)
- # boot (89)
- # braveandtrue (1)
- # cider (1)
- # cljs-dev (33)
- # cljsjs (1)
- # cljsrn (147)
- # clojure (149)
- # clojure-quebec (1)
- # clojure-russia (82)
- # clojure-spec (18)
- # clojure-taiwan (2)
- # clojure-uk (15)
- # clojurescript (97)
- # cursive (11)
- # datomic (22)
- # funcool (2)
- # hoplon (53)
- # immutant (16)
- # jobs-rus (8)
- # lambdaisland (1)
- # off-topic (13)
- # om (7)
- # onyx (58)
- # parinfer (6)
- # planck (19)
- # protorepl (2)
- # re-frame (17)
- # reagent (201)
- # rum (6)
- # specter (9)
- # test-check (68)
- # untangled (47)
- # yada (94)
@seancorfield: (require
instead of (:require
also breaks tools.namespace
or makes it unreliable
I actually found a case of it in an old version of tools.namespace too (long since fixed)
Hi. Back trying to integrate spec into http api-libs for (border) runtime validation, but need to figure out how to do selective conforming based on runtime parameters (which is needed to do this right). Wrote a small gist of how this is done with Schema - https://gist.github.com/ikitommi/17602f0d08f754f89a4c6a029d8dd47e. Any clues how to do this with spec? Writing conformers that read dynamic vars? Wait for the next alpha? 😉
Short of writing a custom generator, is there a way to limit the depth of a generated tree from a recursive spec?
@dave.dixon why do you need to limit it?
there might be a var for that actually
but I'm still curious why that need comes up
@gfredericks: I'm getting stack overflow exceptions. Actually not sure if that's the real issue anyway, since I only get the when I wrap the spec in with-gen
to try and limit the number of entries.
@gfredericks: Come to think of it, they way I'm specifying the tree probably isn't right, since there's an additional restriction on the leaves. Guessing that means I need to write my own generator anyway.
test.check has a helper for recursive generators
you have to be careful with sizing though :/
sizing and recursion have a weird relationship
@gfredericks: using clojure.spec/*recursion-limit*
. Sometimes I get answer from exercise
, sometimes a stack overflow.
the *recursion-limit*
var and the test.check recursion helper are mutually exclusive
the former only applies to the built-in generator clojure.spec gives you for for recursive specs
I need to write some documentation on sizing in test.check
related to my runtime-coercion question. did a spike about using dynamic var to define the environment for the conformations: * specs define a special “type” predicate as a first predicate. Allows type-based conformations & allows easy generation of api-docs (we are doing the spec->swagger, https://github.com/metosin/ring-swagger/issues/95) * type predicates know how to conform value in different environment (should be recursive): string, json & edn formats get all different treatment. Using a dynamic var sounds like a bad idea, but coudn’t figure out any other way to do this. Any comments?