This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-02-13
Channels
- # bangalore-clj (1)
- # beginners (29)
- # boot (13)
- # braveandtrue (5)
- # clara (5)
- # cljs-dev (42)
- # cljsrn (7)
- # clojure (55)
- # clojure-france (46)
- # clojure-nl (11)
- # clojure-portugal (1)
- # clojure-russia (268)
- # clojure-spec (26)
- # clojure-uk (32)
- # clojurescript (173)
- # clr (2)
- # core-async (46)
- # cursive (22)
- # datomic (33)
- # devcards (1)
- # emacs (5)
- # events (8)
- # figwheel (2)
- # flambo (4)
- # instaparse (8)
- # jobs (11)
- # klipse (46)
- # lein-figwheel (3)
- # london-clojurians (2)
- # nrepl (1)
- # off-topic (29)
- # om (4)
- # om-next (8)
- # pedestal (3)
- # rdf (4)
- # re-frame (51)
- # reagent (104)
- # remote-jobs (1)
- # rum (4)
- # schema (2)
- # specter (19)
- # untangled (16)
- # vim (52)
@nathanmarz: Does this look like valid usage?
(specter/select
(specter/with-fresh-collected
(specter/collect-one (specter/keypath 0))
(specter/cond-path
(specter/collected? [x] (even? x))
(specter/keypath 1)
(specter/collected? [n] (odd? n))
(specter/keypath 2)))
[1 "even" "odd"])
(specter/select
(specter/comp-paths (specter/collect-one :type)
(specter/collected? [type]
(clojure.tools.trace/trace "type" type)
true)
(specter/if-path
(specter/collected? [type]
(clojure.tools.trace/trace "type" type)
(= :a type))
:a
:b))
{:type :a
:a "a"
:b "b"})
@zane yea looks like a bug
vals aren't being passed to condition paths for if-path
/`cond-path`
yes, thanks
@zane btw you can handle your previous use case with:
(if-path [(keypath 0) even?] (keypath 1) (keypath 2))
Yeah, my actual use case has more than two branches, @nathanmarz. 😞