Sequence and Eduction produce infinite loop in transducer that appends to the reduction

Description

Example: a transducer that appends :foo to the result of the reduction:

In Clojure, the above code yields

. In ClojureScript, it results in an infinite loop. The same happens with `eduction`.
However,

doesn't produce an error.

Environment

None

Activity

Show:
António Monteiro
May 12, 2017, 8:13 PM

I'm looking into fixing this one.

António Monteiro
May 12, 2017, 9:46 PM

The implementation of transducers in ClojureScript tracked an old counterpart in
the Clojure codebase. This patch addresses the change introduced in the
following commit to Clojure, which replaced `LazyTransformer` with
`TransformerIterator`, effectively making the transducer behavior akin to the
one in Clojure.

https://github.com/clojure/clojure/commit/c47e1bbcfa227723df28d1c9e0a6df2bcb0fecc1

Attached patch with fix and test.

Mike Fikes
July 18, 2017, 1:37 PM

See regression in CLJS-2258.

Completed

Assignee

David Nolen

Reporter

António Monteiro

Labels

Approval

None

Patch

Code and Test

Fix versions

Priority

Minor