Home United States USA — software Swift 3.1 Improves Language, Package Manager, and Linux Implementation

Swift 3.1 Improves Language, Package Manager, and Linux Implementation

330
0
SHARE

Staying true to its plan, the recently announced Swift 3.1 is source compatible with Swift 3.0. Still, it includes a number of changes to the language, the standard library, and improved Linux implementation.
Staying true to its plan, the recently announced Swift 3.1 is source compatible with Swift 3.0. Still, it includes a number of changes to the language, the standard library, and improved Linux implementation.
On the language front, two new members have been added to the Sequence protocol: drop(while:) and prefix(while:). They return the subsequence obtained by dropping or including the initial elements of a sequence while a given predicate is true. So, if you have a sequence s , you can take its n-th to m-th subsequence by executing:
Swift 3.1 also adds a number of conversion initializers for all numeric types, including Int , Float , and Double types, which either produce a correct result, or return nil.

Continue reading...