This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-01-03
Channels
- # aws (27)
- # beginners (64)
- # boot (14)
- # calva (10)
- # cider (36)
- # cljs-dev (13)
- # cljsrn (79)
- # clojure (58)
- # clojure-berlin (8)
- # clojure-france (1)
- # clojure-italy (18)
- # clojure-nl (9)
- # clojure-russia (1)
- # clojure-spec (28)
- # clojure-uk (29)
- # clojurescript (55)
- # core-async (20)
- # cursive (5)
- # datomic (105)
- # emacs (17)
- # figwheel-main (13)
- # fulcro (20)
- # graphql (4)
- # hoplon (1)
- # hyperfiddle (2)
- # jobs (7)
- # jobs-discuss (110)
- # off-topic (23)
- # pathom (1)
- # perun (2)
- # re-frame (87)
- # reitit (2)
- # shadow-cljs (8)
- # spacemacs (2)
- # tools-deps (118)
- # vim (11)
Hi everyone! Just curious, does anybody know when clojure/clojurescript with spec/schema
and spec/select
will be released? I like this idea and want to try it 🙂
We have not started developing it yet, so not soon :)
thank you for info 🙂
what is generally preferred in specs?
(s/nilable (s/or ...)
vs (s/or :nil nil? …)
when enumerating alternatives
the first is perf optimized
the generator for nilable is also intentionally unbalanced so it only produces nils 10% of the time
whereas the latter will be 1/n where n = # of options
not sure what you mean. do you mean nilable vs alt on nil?
if so, then that’s a different situation as s/nilable is not a regex and won’t compose in the same way as s/alt with other regex ops
s/alt is a regex op and composes with other regex ops to describe a single sequential structure
s/or is not a regex op
so acts as an independent value
sometimes the spec for :x can be taken apart and then it only makes sense to do it with or to make it re-usable on a single value
it depends here on what … is
in some cases, there is no perceptible difference
there are cases where you might want s/alt and some where you might want s/or
if you’re describing alternatives of the sequential structure, then probably s/alt
if you’re describing alternate value sets that occur at a particular point in the structure, then probably s/or
usually the s/alt case will contain more regex ops inside the … whereas the s/or will not