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
Labels
feature A feature request or implementation good first issue Good for newcomers standard library Area: Standard library umbrella swift evolution proposal needed Flag → feature: A feature that warrants a Swift evolution proposal

Comments

@airspeedswift
Copy link
Member

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

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
@AnthonyLatsis AnthonyLatsis added good first issue Good for newcomers feature A feature request or implementation swift evolution proposal needed Flag → feature: A feature that warrants a Swift evolution proposal and removed new feature StarterProposal labels Nov 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A feature request or implementation good first issue Good for newcomers standard library Area: Standard library umbrella swift evolution proposal needed Flag → feature: A feature that warrants a Swift evolution proposal
Projects
None yet
Development

No branches or pull requests

3 participants