Clojure

Add 2-arity version of `cycle` that takes the numer of times to "repeat" the coll

Details

  • Type: Enhancement Enhancement
  • Status: Open Open
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Patch:
    Code

Description

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)

Activity

Nicola Mometto made changes -
Field Original Value New Value
Patch Code [ 10001 ]
Nicola Mometto made changes -
Attachment 0001-Add-2-arity-version-of-cycle-that-takes-the-number-o.patch [ 12965 ]
Nicola Mometto made changes -
Édipo L Féderle made changes -
Labels patch
Andy Fingerhut made changes -
Labels patch

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated: