partition-by runs infinite loop when one element of infinite partition is accessed

Description

The reason is that partition-by counts and thus realizes each current partition to call itself recursively.

It seems like unexpected behavior, since the user may not intend to realize the entire partition.

Approach: Change from using seq to lazy-seq in its last line

Patch: clj-1764.patch

Screened-by: Alex Miller - I did a perf check too and seemed to be about the same, possibly even faster on average (gc effects mean there is a lot of deviation).

Environment

None

Attachments

1

Activity

Show:

importJuly 23, 2015 at 8:36 PM

Patch as suggested by Leon, + test.

Completed

Details

Assignee

Reporter

Approval

Ok

Patch

Code and Test

Priority

Affects versions

Fix versions

Created June 19, 2015 at 4:48 PM
Updated September 14, 2018 at 10:21 PM
Resolved September 14, 2018 at 10:21 PM