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-10063] Swift.org: package manager example claims no RNG in swift stdlib #4726

Open
karwa opened this issue Mar 8, 2019 · 4 comments
Open
Labels

Comments

@karwa
Copy link
Contributor

karwa commented Mar 8, 2019

Previous ID SR-10063
Radar None
Original Reporter @karwa
Type Bug
Additional Detail from JIRA
Votes 0
Component/s Package Manager
Labels Bug
Assignee None
Priority Medium

md5: e6c125ab85d5febb5f9741449b6d35b1

Issue Description:

https://swift.org/package-manager/

Under "Using Build Configuration Statements"

> The implementation of shuffleInPlace() uses the Fisher-Yates algorithm to randomly permute the elements in a collection. Because the Swift Standard Library does not provide a random number generator, this method must call a function imported from a system module. For this function to be compatible with both macOS and Linux, the code uses build configuration statements.

We can probably leave the example package as-is, but it might be confusing for new users to read the above statement. They might think there is some good reason not to use the RNG and collection-shuffling which does now exist in the standard library.

Perhaps something like "pretend the standard library did not provide a random number generator"?

@belkadan
Copy link

cc @aciidb0mb3r

@ankitspd
Copy link
Member

The example package predates the random number features in stdlib but, yeah, we should update the examples.

@belkadan
Copy link

Ah, this isn't a starter bug because people outside Apple can't update the website.

@ankitspd
Copy link
Member

Ah, right

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

No branches or pull requests

4 participants