This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-09-17
Channels
- # announcements (2)
- # aws (7)
- # beginners (46)
- # cider (15)
- # clj-kondo (24)
- # cljs-dev (3)
- # clojure (46)
- # clojure-dev (34)
- # clojure-europe (7)
- # clojure-italy (7)
- # clojure-nl (10)
- # clojure-norway (15)
- # clojure-spec (5)
- # clojure-uk (42)
- # clojuredesign-podcast (1)
- # clojurescript (79)
- # clr (3)
- # core-async (1)
- # cursive (45)
- # data-science (1)
- # datomic (4)
- # fulcro (17)
- # funcool (14)
- # gorilla (2)
- # graphql (30)
- # jackdaw (5)
- # jobs-discuss (8)
- # joker (4)
- # lein-figwheel (1)
- # off-topic (48)
- # pedestal (26)
- # re-frame (36)
- # reagent (18)
- # reitit (6)
- # remote-jobs (4)
- # shadow-cljs (115)
- # tools-deps (62)
- # vim (12)
Can't speak to intention, but that predicate has an invariant assumption: that the arg is a collection. Neither true nor false would be valid answers. The error can be avoided by first checking that the invariant assumption holds:
user=> (s/valid? (s/and coll? empty?) 1)
false
Is it possible to dynamically generate specs at runtime? For example, based on a runtime value, I call a fn that returns a vector of namespaced keys. I then generate a spec like (s/keys :req vector-of-keys)
. Since keys
is a macro, I haven’t been able to find a way
you'll need to eval somehow, either by explicitly using eval
or by wrapping in another macro that uses backtick
(in spec 2, we've made this much easier)
Great, looking forward to spec2