Affects versions: Release 1.7
Fix versions: None
Note: I initially raised this issue for discussion on the mailing list
transduce and other transducible processes currently ignore the 'init' arity of transducers. The currently implementation of transduce takes the 'init' from the reducing function before being transformed by the transducer, rather the reducing function after being transformed.
The current implementation of transduce is equivalent to the following (simplified for exposition purposes):
The arity 3 case uses (f) to construct the seed value of the reduction. The arity 4 case uses the explicitly provided seed, init.
I would like to propose an alternate implementation of transduce, one which makes use of the transducer when seeding the reduction.
Now, the arity 3 case uses (xform f) to construct the seed value of the reduction. The arity 4 case combines both f and init into a new reducing function that is given to xform. Both of these ensure that the init arity of the transducer is used.
As into is implemented in terms of transduce, it is also taken care of. However, sequence is separate, and would also have to be tweaked to respect the init arity.