Fork me on GitHub
#core-async
<
2018-09-04
>
xiongtx07:09:30

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

xiongtx08:09:40

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!`)?

Alex Miller (Clojure team)10:09:29

An expanding transducer like mapcat will do it more than once via reduce

xiongtx18:09:56

Do what more than once?