This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-10-20
Channels
- # announcements (2)
- # beginners (108)
- # cljdoc (9)
- # clojars (1)
- # clojure (33)
- # clojure-spec (20)
- # clojure-uk (9)
- # clojurescript (23)
- # datascript (1)
- # datomic (5)
- # emacs (3)
- # fulcro (15)
- # graphql (1)
- # jobs (7)
- # lumo (12)
- # off-topic (40)
- # ring-swagger (1)
- # shadow-cljs (1)
- # tools-deps (7)
- # unrepl (6)
- # vim (1)
(s/valid? ::reducing-fn (fn [x y]) ;; takes forever and ends with a out of heap memory
So it seems (because test.check
needs to be a dep for this to run) that spec is using generative testing to verify if the spec is valid.
Hmm, do I actually have a question? No, probably not, I just wanted to state that I was surprised by this, but it’s probably just the way it has to be.
Is there a spec which forces a certain value? same as #(= % some-value)
but with a built-in generator, etc
@U3DAE8HMG how so?
@U3DAE8HMG oh yes sorry, nevermind
Seems like some macros/special forms have different ways of catching/reporting insufficient input
user=> (let)
Syntax error macroexpanding clojure.core/let at (4:1).
() - failed: Insufficient input at: [:bindings] spec: :clojure.core.specs.alpha/bindings
user=> (defn)
Syntax error macroexpanding clojure.core/defn at (5:1).
() - failed: Insufficient input at: [:fn-name] spec: :clojure.core.specs.alpha/defn-args
user=> (fn)
Syntax error macroexpanding clojure.core/fn at (6:1).
() - failed: Insufficient input at: [:fn-tail]
user=> (def)
Syntax error compiling def at (7:1).
Too few arguments to def
user=> (if)
Syntax error compiling if at (1:1).
Too few arguments to if
your examples are distinguished by whether it's a special form or not
I get different results on version 1.10.0-alpha6
especially interestingly, (fn*)
compiles
it seems to produce a function that throws an arity exception on any call