This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-05-11
Channels
- # announcements (4)
- # babashka (4)
- # beginners (164)
- # calva (47)
- # cider (1)
- # cljs-dev (29)
- # cljsrn (3)
- # clojure (137)
- # clojure-europe (23)
- # clojure-nl (3)
- # clojure-spec (7)
- # clojure-uk (44)
- # clojurescript (35)
- # component (8)
- # conjure (119)
- # cursive (32)
- # datomic (12)
- # emacs (31)
- # figwheel-main (36)
- # graalvm (10)
- # jobs (2)
- # kaocha (1)
- # lein-figwheel (3)
- # meander (15)
- # mount (3)
- # off-topic (9)
- # pathom (8)
- # quil (4)
- # re-frame (13)
- # reagent (15)
- # remote-jobs (10)
- # shadow-cljs (128)
- # slack-help (2)
- # spacemacs (8)
- # test-check (6)
- # xtdb (6)
How do I use Spec with core.async? E.g. how do I spec a function that returns a channel where I'll put! another spec on? Or do I need to wrap it in some kind of record for this?
you can spec that something is a Channel, but that’s not very useful, so you probably want to spec the values at the points where you put/take them
Yes, I realized that I could spec the channel transducers that interpret incoming values on put!.
I'm seeing strange behavior in spec alpha2 (latest github commit). If I define a schema using the map form, to specify non-namespaced keywords, refer to it from another schema, and later try to generate data from a selection of latter schema, I get an "Unable to resolve spec" exception:
; Context
(s/def ::foo int?)
(s/def ::inner (s/schema {:foo ::foo}))
(s/def ::outer (s/schema [::inner]))
; Works as expected:
(s/exercise ::outer)
(s/exercise (s/select ::inner [*]))
; Fails with "Unable to resolve spec: :foo"
(s/exercise (s/select ::outer [*]))
Is this expected, should I change something in my code, or is it a bug that I should report somewhere?
Spec 2 is very much a work in progress and isn't ready for folks to use -- and, yes, it has numerous bugs in it @rafael
Yeah, so far I'm finding workarounds. I think I can work around this one as well with s/keys
Yes, I realized that I could spec the channel transducers that interpret incoming values on put!.