Re: [ANN] Clojure 1.9.0-alpha8

2016-06-29 Thread Simon Belak
Missed that s/nilable exists. Cheers.  On 29 June 2016 at 16:04:05, Alex Miller (a...@puredanger.com) wrote: Also, you can turn any predicate into a nil-accepting predicate with s/nilable. user=> (s/valid? (s/nilable (s/every ::s/any)) nil) true On Wednesday, June 29, 2016 at 9:02:43 AM UTC-5,

Re: [ANN] Clojure 1.9.0-alpha8

2016-06-29 Thread Alex Miller
Also, you can turn any predicate into a nil-accepting predicate with s/nilable. user=> (s/valid? (s/nilable (s/every ::s/any)) nil) true On Wednesday, June 29, 2016 at 9:02:43 AM UTC-5, Alex Miller wrote: > > user=> (s/explain (s/every ::s/any) nil) > val: nil fails predicate: coll? > > indicate

Re: [ANN] Clojure 1.9.0-alpha8

2016-06-29 Thread Alex Miller
user=> (s/explain (s/every ::s/any) nil) val: nil fails predicate: coll? indicates that s/every (also s/coll-of) validate using coll? as the predicate and coll? (like most type predicates) does not validate nil. nil punning is more often done for sequences. Sequences with structure are typicall

Re: [ANN] Clojure 1.9.0-alpha8

2016-06-29 Thread Simon Belak
map-of now conforming is fantastic news! One question though: why doesn't every validate when given nil for collection? Seems inconsistent given pervasive nil punning elsewhere and that [] validates. s On Wednesday, June 29, 2016 at 12:13:25 AM UTC+2, Alex Miller wrote: > > Clojure 1.9.0-alph

Re: [ANN] Clojure 1.9.0-alpha8

2016-06-28 Thread Alex Miller
I've updated the spec guide for Clojure 1.9.0-alpha8 and I will add some more to it later about s/merge and probably some on the new instrument mock/stub capabilities. http://clojure.org/guides/spec Alex On Tuesday, June 28, 2016 at 5:13:25 PM UTC-5, Alex Miller wrote: > > Clojure 1.9.0-alpha8

Re: [ANN] Clojure 1.9.0-alpha8

2016-06-28 Thread Alex Miller
The two jiras are here: http://dev.clojure.org/jira/browse/CLJ-1910 http://dev.clojure.org/jira/browse/CLJ-1919 I'll be working on updating clojure.org docs tomorrow. Alex On Tuesday, June 28, 2016 at 9:39:58 PM UTC-5, Colin Fleming wrote: > > Is there a JIRA with details on the namespaced key

Re: [ANN] Clojure 1.9.0-alpha8

2016-06-28 Thread Colin Fleming
Is there a JIRA with details on the namespaced keyword changes? On 29 June 2016 at 11:48, Leon Grapenthin wrote: > This is fantastic. Spec really seems to turn out like a "killer-feature" > for Clojure. > > On Wednesday, June 29, 2016 at 12:13:25 AM UTC+2, Alex Miller wrote: >> >> Clojure 1.9.0-

Re: [ANN] Clojure 1.9.0-alpha8

2016-06-28 Thread Leon Grapenthin
This is fantastic. Spec really seems to turn out like a "killer-feature" for Clojure. On Wednesday, June 29, 2016 at 12:13:25 AM UTC+2, Alex Miller wrote: > > Clojure 1.9.0-alpha8 is now available. > > Try it via > > - Download: > https://repo1.maven.org/maven2/org/clojure/clojure/1.9.0-alpha8 >

Re: [ANN] Clojure 1.9.0-alpha8

2016-06-28 Thread Leon Grapenthin
I welcome the current naming because for the naming to be consistent it is also necessary that names and forms of spec describe what is expected of specified data. In fact every does require every element to conform to a spec, not just some so it is semantically correct. (s/sample (s/and num

Re: [ANN] Clojure 1.9.0-alpha8

2016-06-28 Thread Alex Miller
The "every" part refers to requirement, not enforcement. Here "every" means that this is what the rule is (and not about how you verify them). I don't want to bikeshed the names - they have been discussed at length and they're not going to change. On Tuesday, June 28, 2016 at 5:37:22 PM UTC-5,

Re: [ANN] Clojure 1.9.0-alpha8

2016-06-28 Thread Daniel Compton
I know these were just changed from map-of and coll-of, but the names every and every-kv seem a little confusing. every and every-kv only sample from collections, whereas the name implies that everything in the collection is checked. Additionally, there is an every? in clojure.core which does check

[ANN] Clojure 1.9.0-alpha8

2016-06-28 Thread Alex Miller
Clojure 1.9.0-alpha8 is now available. Try it via - Download: https://repo1.maven.org/maven2/org/clojure/clojure/1.9.0-alpha8 - Dependency: [org.clojure/clojure "1.9.0-alpha8"] 1.9.0-alpha8 includes the following changes since 1.9.0-alpha7: The collection spec support has been greatly enhanced,