cycle is too eager

Description

Same as CLJ-1692, cycle realizes one element ahead in next(), which is different than before CLJ-1603 was applied:

Approach: Delay realization until first is called.

Patch: clj-1694.patch

Environment

None

Attachments

1

Activity

Show:

Nicola Mometto April 3, 2015 at 9:21 PM

The regression does exist, just a bad example.
Here's a valid one:

Alex Miller April 3, 2015 at 8:56 PM

Actually, the behavior here is no different vs before.

(take 2 (cycle (map #(/ 42 %) (range 31 -1 -1))))
;; exception

(take 2 (cycle (map #(/ 42 %) (range 32 -1 -1))))
;; works

Just a side effect of chunking and afaict not any different than before.

Completed

Details

Assignee

Reporter

Approval

Ok

Patch

Code and Test

Priority

Affects versions

Fix versions

Created April 3, 2015 at 8:48 PM
Updated April 10, 2015 at 7:50 PM
Resolved April 10, 2015 at 7:50 PM