Welcome! Please see the About page for a little more info on how this works.

0 votes
in Clojure by

There are already similar arities for repeat/repeatedly and similar functions, this patch adds a 2-arity version of cycle that behaves like this:

user> (cycle 0 '(1 2)) () user> (cycle -1 '(1 2)) () user> (cycle 3 '(1 2)) (1 2 1 2 1 2) user> (cycle 1 '(1 2)) (1 2)

3 Answers

0 votes
by

Comment made by: jafingerhut

Patch 0001-Add-2-arity-version-of-cycle-that-takes-the-number-o.patch dated Apr 28 2014 no longer applies cleanly to latest Clojure master due to some changes committed earlier today. This appears trivial to update, as it is likely only a couple of lines of diff context that have changed.

0 votes
by

Comment made by: bronsa

Updated patch to apply to HEAD

0 votes
by
Reference: https://clojure.atlassian.net/browse/CLJ-1412 (reported by bronsa)
...