Re: Custom generators for custom predicate functions

2016-12-08 Thread Dave Dixon
Thanks Alex. I agree it probably isn't "needed", was just a little surprised to discover the asymmetry. Mostly was curious if there was some deeper design decision, e.g. that you need to start with some set of primitive predicates upon which you can start building named specs. On Thursday, Dece

Re: Custom generators for custom predicate functions

2016-12-08 Thread Alex Miller
In general, you shouldn't need to do this (it is better to attach the generator to the spec). Generator mappings are provided for core Clojure predicates so that many common predicates gen automatically and so that they can be combined (via things like s/and) with other predicates that filter b

Custom generators for custom predicate functions

2016-12-08 Thread Dave Dixon
Though one can obviously attach a custom generator to a keyword-named spec, it appears there is no way to do the same for a custom predicate function. I see that the generators for predicate functions testing for core primitives are hard-coded in the private clojure.spec.gen\gen-builtins. Curio