sequence with transducers realizes n+2 elements

Description

The first element is realized at creation time:

Fully realizing the sequence realizes the other n-1 elements, and 2 more:

Compare with version using seq operations:

Transduce also doesn't seem to exhibit this issue:

Environment

None

Attachments

2

Activity

Show:

Alex Miller August 8, 2014 at 5:12 PM

Fixed by Rich directly, not by patch.

Nicola Mometto August 8, 2014 at 4:16 PM

Nice, I added a commit on top of yours to delay the realization of the first element of the lazyseq to the first .next call instead of on SeqIteration creation

Alex Miller August 8, 2014 at 4:02 PM

Patch attached that improves the issue - will now only realize n+1 elements.

Completed

Details

Assignee

Reporter

Approval

Ok

Priority

Affects versions

Fix versions

Created August 8, 2014 at 10:26 AM
Updated August 8, 2014 at 5:12 PM
Resolved August 8, 2014 at 5:12 PM