This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-03-21
Channels
- # beginners (38)
- # boot (88)
- # cljs-dev (142)
- # cljsrn (2)
- # clojars (1)
- # clojure (107)
- # clojure-berlin (2)
- # clojure-italy (8)
- # clojure-russia (76)
- # clojure-spec (325)
- # clojure-taiwan (3)
- # clojure-uk (28)
- # clojurescript (80)
- # clojurewest (2)
- # core-async (36)
- # core-logic (1)
- # cursive (21)
- # datomic (16)
- # dirac (18)
- # docs (2)
- # emacs (1)
- # euroclojure (3)
- # garden (3)
- # gsoc (2)
- # hoplon (3)
- # immutant (4)
- # jobs-discuss (16)
- # lein-figwheel (5)
- # liberator (17)
- # lumo (19)
- # off-topic (2)
- # om (20)
- # onyx (28)
- # pedestal (50)
- # planck (4)
- # re-frame (5)
- # reagent (3)
- # ring-swagger (13)
- # spacemacs (1)
- # specter (43)
- # testing (3)
- # timbre (3)
- # uncomplicate (1)
- # vim (2)
- # yada (4)
you can provide (map f) as an optional arg when creating the channel
or, if you don’t control channel creation, you can pipe into your channel
it takes a from channel and a to channel
put the (map f) transducer on the to channel
or even pipeline with an xf arg maybe?
I would go with pipe though, less complex
pipe plus a chan with a transducer does what you want
nil is equivalent to chan with no args
this seems like something common enough that it should be in the std lib though honestly
pipe is in the stdlib
a) create a chan passing xfm, b) call pipe with orig chan and newly created chan from a
johanatan map> exists, and is explicitly deprecated in favor of using a map transducer as we’ve just described
so it exists, but authors think you shouldn’t use it any more
ahh, yea, i figured that's what that was but since it's deprecated there's no documentation explaining what it is
well, not using it amounts to me re-writing it in the form of a helper that calls the transducer way
oh wait, core.async/map still exists, is not deprecated, and directly does what you want
n can be 1
map also maps over n collections
usually n is 1, but it’s still n
(async/map f [c]) should work
i tried calling it like: (map :a-kwd src-channel)
rather than (map :a-kwd [src-channel])
I always do that when I’m using alts!