On Wednesday, June 15, 2016 at 1:36:54 PM UTC-5, Oded Badt wrote:
>
> From https://clojure.org/guides/spec#_collections:
> *One important aspect of coll-of and map-of is that they both sample their
> inputs, checking only a subset of the values for performance reasons. Due
> to this, conform of these specs does not flow conformed values (because
> they are not all conformed).*
>
>
This is really referring to something like this:
(s/explain (s/map-of keyword? string?) (zipmap (range 10) (range 10))
val: {0 0, 7 7, 1 1, 4 4, 6 6, 3 3, 2 2, 9 9, 5 5, 8 8} fails predicate:
(coll-checker (tuple keyword? string?))
The spec fails but does not indicate more precisely the tuple where the
error failed.
> From playing around a bit and reading the sources I came to the conclusion
> that the above means that values are indeed returned by conform but those
> values (specifically, from the sources, after the first 100 values) do
> not necessarily conform to the predicates, is that the correct way to read
> the above?
>
But also, yes that is how the predicates are checked.
> Are there any plans of implementing a more statistical approach in the
> future in order to increase the chance of finding bugs?
>
No.
>
> Is it a bad idea to bind *coll-check-limit* to infinity in a local thread
> binding for more thorough possibly time and CPU consuming testing of a
> specific function?
>
That's up to you. Because this has come up a number of times, Rich may add
some variant for this kind of thing in the future.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.