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,
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
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
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
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
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
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-
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
>
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
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,
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
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,
12 matches
Mail list logo