Add binding conveyance to reducers.

Description

Clojure reducers is the only parallel construct that does not support binding conveyance.

1 2 3 4 5 6 (def ^:dynamic bar "In main thread.") (binding [bar "In reducers Thread."] (r/fold (fn [& args] bar) (vec (range 100000)))) => "In main thread."

You have to manually use bound-fn:

1 2 3 4 (binding [bar "In reducers Thread."] (r/fold (bound-fn [& args] bar) (vec (range 100000)))) => "In reducers Thread."

I propose it is enhanced to behave the same as pmap, future, agents and core.async.

Environment

None

Status

Assignee

Unassigned

Reporter

import

Labels

Approval

Triaged

Patch

None

Affects versions

Release 1.8

Priority

Minor