This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-09-04
Channels
- # announcements (5)
- # beginners (124)
- # boot (43)
- # braveandtrue (8)
- # calva (1)
- # cider (44)
- # cljs-dev (1)
- # clojure (188)
- # clojure-canada (3)
- # clojure-germany (1)
- # clojure-italy (5)
- # clojure-nl (13)
- # clojure-russia (1)
- # clojure-spec (14)
- # clojure-uk (42)
- # clojurescript (94)
- # core-async (5)
- # cursive (5)
- # datomic (45)
- # duct (3)
- # emacs (6)
- # figwheel-main (93)
- # fulcro (22)
- # graphql (3)
- # hyperfiddle (1)
- # leiningen (3)
- # off-topic (1)
- # pedestal (1)
- # play-clj (1)
- # portkey (1)
- # re-frame (17)
- # reagent (71)
- # remote-jobs (2)
- # rum (3)
- # shadow-cljs (45)
- # spacemacs (17)
- # specter (18)
- # tools-deps (27)
- # unrepl (1)
- # vim (3)
What's the purpose of these calls to reduced?
on add!
? https://github.com/clojure/core.async/blob/core.async-0.4.474/src/main/clojure/clojure/core/async/impl/channels.clj#L83
AFAICT the add!
function, which dispatches to add!*
methods, never returns a clojure.lang.Reduced
, at least for the built-in buffer types. https://github.com/clojure/core.async/blob/core.async-0.4.474/src/main/clojure/clojure/core/async/impl/buffers.clj#L22
This (add! buf)
seems to have no purpose other than returning the buffer: https://github.com/clojure/core.async/blob/core.async-0.4.474/src/main/clojure/clojure/core/async/impl/channels.clj#L224
Is that right? That seems to be the case based on the implementation of add!
: https://github.com/clojure/core.async/blob/core.async-0.4.474/src/main/clojure/clojure/core/async/impl/protocols.clj#L38
Ah, I think the first has to do w/ transducers like (take-while pred)
that can returned a reduced value. The second too, probably--is there a transducer which, given a result
(`buf`), does something other than simply passing it to rf
(`add!`)?
An expanding transducer like mapcat will do it more than once via reduce