This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-10-20
Channels
- # ai (1)
- # beginners (17)
- # boot (27)
- # cider (2)
- # cljs-dev (64)
- # clojure (131)
- # clojure-austin (13)
- # clojure-dev (15)
- # clojure-dusseldorf (11)
- # clojure-france (45)
- # clojure-russia (19)
- # clojure-spec (66)
- # clojure-uk (22)
- # clojurescript (97)
- # core-logic (7)
- # cursive (5)
- # data-science (1)
- # datomic (92)
- # dirac (49)
- # emacs (1)
- # events (5)
- # funcool (10)
- # hoplon (79)
- # jobs (1)
- # jobs-rus (1)
- # lein-figwheel (1)
- # leiningen (3)
- # om (14)
- # onyx (35)
- # planck (2)
- # proton (1)
- # re-frame (21)
- # reagent (2)
- # ring-swagger (10)
- # spacemacs (10)
- # specter (18)
- # untangled (7)
- # vim (23)
That's right
s/def updates the registry so that needs to occur before you can use the spec
how do you wrap a function that returns values to be used as gen that don't depend and randomisation at test.check level (it's an external lib that already does this (sentence generation))
I know I can (gen/fmap (fn [_] (some-lib/foo)) (gen/any))
but that seems a bit too convoluted
gen/return ?
The fact that foo doesn't rely on test.checks notions of randomness is actually a problem (as it can't play in growing, shrinking, or creating reproducible results)
But I think you could also use gen/bind to do this
Yeah, I'm thinking of it as a gen
I guess its not any better than what you had with fmap
I mean you could directly satisfy the test.check requirements to be a generator
I think it's just a record with a function field
Something like that
Well you're starting from the position of doing something you shouldn't :)
So it's going to feel wrong whatever you do
First time I've seen it asked
Since you're not going to use the value, I'd pick a simpler generator than any?
If you're doing the fmap one
Does anyone have any tips on how to use clojure.spec/keys on Datomic entities? Looking for a workaround for the following http://dev.clojure.org/jira/browse/CLJ-2041
I don't know that there is a solution to 2041 btw
currently hurting us bad, since we work with entities all over, treating them as maps
The lighter weight lookup interfaces do not have a way to iterate over entries which keys needs to do
I know this has been discussed re Datomic but I'm not sure where things will end up
is there a spec equivalent of annotating types using the s/defn
, etc. macros in schema with :-
and all that?
also, so the name of a spec is a key that corresponds to what it must be called in a map, but also is just the name of a thing if you’re using it not in a map?
@liamd s/keys requires keyword keys for validating maps. if you don't have keyword keys, you'll need to use map-of, coll-of, custom predicates etc
one of my dependencies is broken ""call to clojure.core/defn did not conform to spec""
Most of the libraries "broken" by recent spec versions have already released new versions. What is breaking?
a few different deps, i'm trying to upgrade them now, i'll let you know if it's still broken
This page lists the known ones: http://dev.clojure.org/display/design/Errors+found+with+core+specs
(and what releases have fixes)
I would have expected the error to fairly clearly indicate the source file containing the illegal defn
?
Monger...
Current version is 3.1.0
The problem is the format of :or [auto-connect-retry true]
which should be :or {auto-connect-retry true}
Looks like it was reported in early June and fixed in mid-August https://github.com/michaelklishin/monger/issues/142
So, yeah, you’ll need a newer version of Monger than 3.0.2 @jasonjckn
I updated http://dev.clojure.org/display/design/Errors+found+with+core+specs to show 3.1.0 contains the fix for Monger 3.0.2’s breakage.