You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the second paragraph of subsection 'Using Build Configuration Statements' it says:
"Because the Swift Standard Library does not provide a random number generator, this method must call a function imported from a system module."
The Swift Standard Library has had random APIs since Swift 4.2.
The SPM documentation is now misleading and gives a new Swift user the incorrect impression that they need to manually import and configure lower-level system calls correctly on macOS and Linux to get basic random number functionality.
Suggest updating the documentation to something like.
'Although the Swift Standard Library provides API for random number generation, for demonstration purposes this method will call a function imported from a system module.'
Possibly also adding a note after this section that says:
'Although the shuffleInPlace() method is implemented here for demonstration purposes, the Swift Standard Library provides a shuffle() method to shuffle mutable collections such as Array in place.'
The text was updated successfully, but these errors were encountered:
Environment
swift.org site June 30th, 2019
Additional Detail from JIRA
md5: bf6b68aa10ef925fe7ed79e422fd8f04
Issue Description:
On swift.org in the Package Manager, Example Usage section at URL:
https://swift.org/package-manager/#example-usage
In the second paragraph of subsection 'Using Build Configuration Statements' it says:
"Because the Swift Standard Library does not provide a random number generator, this method must call a function imported from a system module."
The Swift Standard Library has had random APIs since Swift 4.2.
The SPM documentation is now misleading and gives a new Swift user the incorrect impression that they need to manually import and configure lower-level system calls correctly on macOS and Linux to get basic random number functionality.
Suggest updating the documentation to something like.
'Although the Swift Standard Library provides API for random number generation, for demonstration purposes this method will call a function imported from a system module.'
Possibly also adding a note after this section that says:
'Although the shuffleInPlace() method is implemented here for demonstration purposes, the Swift Standard Library provides a shuffle() method to shuffle mutable collections such as Array in place.'
The text was updated successfully, but these errors were encountered: