This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-06-10
Channels
- # aleph (4)
- # announcements (27)
- # aws (12)
- # aws-lambda (1)
- # beginners (207)
- # boot (4)
- # calva (8)
- # cider (9)
- # clj-kondo (9)
- # cljs-dev (27)
- # cljsrn (6)
- # clojure (104)
- # clojure-android (3)
- # clojure-dev (9)
- # clojure-finland (2)
- # clojure-italy (18)
- # clojure-spec (8)
- # clojure-uk (100)
- # clojurescript (43)
- # clojutre (1)
- # core-async (49)
- # cursive (18)
- # data-science (3)
- # duct (24)
- # events (2)
- # fulcro (27)
- # immutant (1)
- # off-topic (32)
- # om (2)
- # onyx (2)
- # pathom (14)
- # pedestal (2)
- # planck (3)
- # re-frame (38)
- # reagent (7)
- # reitit (10)
- # rewrite-clj (7)
- # ring-swagger (3)
- # shadow-cljs (32)
- # spacemacs (63)
- # test-check (16)
- # tools-deps (5)
- # vim (21)
There is an example spec using s/double-in
on the spec guide page: (s/def ::dubs (s/double-in :min -100.0 :max 100.0 :NaN? false :infinite? false))
I have tried changing the false
occurrences to true
, and leaving out the :NaN?
and :infinite?
keys, but I always see (s/valid? ::dubs ##Inf)
evaluate to false
, as well as (s/valid? ::dubs ##-Inf)
and (s/valid? ::dubs ##NaN)
. Is that expected?
I guess it makes sense for ##-Inf
to be invalid if a :min
value is specified that is a double value other than ##-Inf
, and similarly for :max
values and ##Inf
.
But it seems like specifying either :min
or :max
changes the validity of ##NaN
from true to false.
no matter what the value associated with the :NaN?
key happens to be
might be the ordering of the checks
if you (s/form :;dubs) you can see what it expands to
maybe buggy at a glance as it's an s/and and it starts flowing the boolean rather than the double
I doubt that is a hot ticket item for anyone, but created a JIRA ticket as a reminder: https://clojure.atlassian.net/browse/CLJ-2516