Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-6864] Add a "cycle" method to the standard library #49413

Open
airspeedswift opened this issue Jan 29, 2018 · 1 comment
Open

[SR-6864] Add a "cycle" method to the standard library #49413

airspeedswift opened this issue Jan 29, 2018 · 1 comment

Comments

@airspeedswift
Copy link
Member

airspeedswift commented Jan 29, 2018

Previous ID SR-6864
Radar None
Original Reporter @airspeedswift
Type New Feature
Additional Detail from JIRA
Votes 0
Component/s Standard Library
Labels New Feature, StarterProposal
Assignee None
Priority Medium

md5: ce3f8a07c6a7edad8e1997fb1e825980

Issue Description:

It is often useful to cycle over a sequence indefinitely. For example, just like you can write zip(repeatElement("foo", count: Int.max), myArray) and zip(1..., myArray), you could write {{zip([.grey,.white].cycle(), myArray)}}.

@swift-ci
Copy link
Collaborator

swift-ci commented Mar 22, 2018

Comment by erica sadun (JIRA)

What the hey.

Forum pitch: [[Starter Pitch] Introducing a `cycled` method to `Sequence`|https://forums.swift.org/t/starter-pitch-introducing-a-cycled-method-to-sequence/11254/1]

Gist: https://gist.github.com/erica/97e75cd0b6ce9908fea9a6ac0d83276e

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants