This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-11-19
Channels
- # beginners (98)
- # boot (9)
- # business (2)
- # cljs-dev (10)
- # clojars (4)
- # clojure (36)
- # clojure-brasil (1)
- # clojure-dev (3)
- # clojure-poland (3)
- # clojure-russia (39)
- # clojure-spec (29)
- # clojure-uk (8)
- # clojurebridge (1)
- # clojurescript (70)
- # component (3)
- # cursive (2)
- # datomic (2)
- # figwheel (1)
- # hoplon (9)
- # klipse (29)
- # off-topic (7)
- # om (3)
- # onyx (11)
- # overtone (3)
- # rdf (1)
- # re-frame (18)
- # schema (1)
- # spacemacs (1)
- # untangled (5)
I guess I’m wondering how I might build functionality like SuperCollider’s ControlSpec(http://doc.sccode.org/Classes/ControlSpec.html) around Clojure’s spec...
Aside - swap the order of the preds in ::sample
There are lots of ways to either use custom generators or to each piece or to create a generator that applies a function to the default generator for the overall structure (with gen/fmap)
Not sure what's best here but lots of options
There's a talk at the conj in a couple weeks about making music with spec
many thanks @alexmiller… looking forward to music talk (sadly will be digesting via youtube)
I think I need to familiarise my self with generators before I’ll understand what you’ve just suggested! many thanks though - I know what to read up on next
so there is intent to make this more visible but things are not quite in place yet
specifically, you can call s/form on a spec to retrieve the original form and then grab the 2nd and 3rd values in the list
however, these compound specs (int-in, double-in, and inst-in) do not have the original form atm
there are several paths towards that and I’ve been discussing with Rich the best one to take but it’s not implemented yet
ah. ok that seems simple enough for an integer range… a lot more complex for a range of doubles...
If you write a spec for the double-in form, then it's just a conform away
I’m not sure if this is a dumb question. But Is there anyway to include clojure.spec'd functions in a generalized test suite?
I posted an SO question, to clarify: http://stackoverflow.com/questions/40697841/howto-include-clojure-specd-functions-in-a-test-suite
Adding spec’d functions to your running test suite, is sort of discussed in this Google Group thread. But I can’t figure how stest/instrument
is used outside of the repl, in a test suite.
check the pinned items here
@alexmiller Lol!! Too right. Ok, let me have a play.