This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-10-05
Channels
- # aws (1)
- # beginners (57)
- # boot (3)
- # cider (6)
- # clara (49)
- # cljs-dev (47)
- # cljsjs (23)
- # clojure (144)
- # clojure-dev (2)
- # clojure-finland (1)
- # clojure-germany (1)
- # clojure-sg (1)
- # clojure-spec (25)
- # clojure-uk (245)
- # clojurescript (39)
- # core-async (3)
- # cursive (6)
- # datomic (117)
- # emacs (3)
- # fulcro (6)
- # hoplon (10)
- # jobs (7)
- # juxt (5)
- # leiningen (11)
- # om (27)
- # pedestal (4)
- # perun (2)
- # re-frame (22)
- # reagent (35)
- # ring-swagger (11)
- # shadow-cljs (333)
- # spacemacs (10)
- # specter (10)
- # sql (20)
- # vim (8)
@guy I’m not sure about the best way, but mocking can help speed things along if that’s what you’re after. https://github.com/benrady/specific
Thanks @jaymartin have you tried it with the latest version of clojure.spec.alpha (17) ?
No, I’ve just messed about with it playfully. But the ideas should be rather generic.
Is there an equivalent of declare
for specs?
alternatively, is there a way to disable the check to see if a spec name exists when used in other specs?
basically I would like to structure my code in the following order:
(s/def ::x ::y)
(s/def ::y ...)
replacing the first ::y
with (s/and ::y)
seems to work.
feels kinda odd that it doesn't just work, seeing as most of things in spec are lazy evaluated
There is a ticket about this. The intent is that it should work
Oh cool, I'm glad that that is the intent
@aengelberg what do you mean
@guy he means
boot.user=> (s/def ::foo ::bar)
clojure.lang.Compiler$CompilerException: java.lang.Exception: Unable to resolve spec: :boot.user/bar, compiling:(boot.user1422927036988753503.clj:1:1)
he wants to say that the spec for ::foo is the same as the spec for ::bar, and it be ok that the spec ::bar has not been defined yet
@aengelberg when I've wanted that I've just used (s/def ::bar any?)
that works too. thanks