From 42f07cd9fe955296317e58736ca8b6ca5476d89e Mon Sep 17 00:00:00 2001 From: Bas Broek Date: Thu, 5 Apr 2018 17:58:15 +0200 Subject: [PATCH 1/3] Create 2018-04-05-issue-106.md --- _posts/2018-04-05-issue-106.md | 142 +++++++++++++++++++++++++++++++++ 1 file changed, 142 insertions(+) create mode 100644 _posts/2018-04-05-issue-106.md diff --git a/_posts/2018-04-05-issue-106.md b/_posts/2018-04-05-issue-106.md new file mode 100644 index 00000000..c39cebbf --- /dev/null +++ b/_posts/2018-04-05-issue-106.md @@ -0,0 +1,142 @@ +--- +layout: post +title: ! 'Issue #106' +author: gregheo +--- + +> Lo! The forum posts and pitches fly on by
+> What rants and revelations there await?
+> Swift 5 remains a glimmer in the sky
+> As compactMap arrives to disorientate.
+>
+> New Xcode versions, filled with all-new fix-its
+> And random numbers, ascribing golden tickets.
+ +There’s been plenty of news to make developers experience the full range of emotions: [Xcode 9.3](https://developer.apple.com/news/releases/?id=03292018d) with [Swift 4.1](https://swift.org/blog/swift-4-1-released/) made it out of the gate, the WWDC ticket lottery smiled on some and caused gnashing of teeth in others. + +Meanwhile, Swift 4.2 and beyond await us. As a reminder, the final merge into the Swift 4.2 branch before a soak period is [coming up in two weeks, on April 20](https://swift.org/blog/4-2-release-process/). + +What’s new in the world of Swift? Read on! + + + + +### Starter tasks + +- [SR-7323](https://bugs.swift.org/browse/SR-7323): SPM can't handle spaces in path to Xcode +- [SR-7307](https://bugs.swift.org/browse/SR-7307): Warn when a block contains nothing but a defer statement +- [SR-7301](https://bugs.swift.org/browse/SR-7301): Bad fixit suggested for protocol extension implementation for inherited objc protocol +- [SR-7292](https://bugs.swift.org/browse/SR-7292): Swift local refactoring: adding field-wise initializers automatically +- [SR-7266](https://bugs.swift.org/browse/SR-7266): `reversed()` applied multiple times should not nest `ReversedCollection` into itself + +{% include task_remind.html %} + + +### Swift Unwrapped + +[Episode 51](https://spec.fm/podcasts/swift-unwrapped/125760) is the long-awaited Part 2 of Doug Gregor and Ben Cohen discussing Swift 4.1. + +In [Episode 52](https://spec.fm/podcasts/swift-unwrapped/129738), JP and Jesse cover two new pitches regarding Swift Package Manager. + + +### News and community + +Languages & Runtime manager [Ted Kremenek](https://twitter.com/tkremenek) shared photos of some [new office decorations over at Swift HQ](https://twitter.com/tkremenek/status/977268865066450944). 🤖 + +[Chris Lattner](https://twitter.com/clattner_llvm) announced [Swift for TensorFlow](https://groups.google.com/a/tensorflow.org/forum/#!topic/swift/xtXCEvtDe5Q), bringing first-class compiler and language support for the machine learning framework. Aside from the post, you can also check out [the video announcement](https://www.youtube.com/watch?list=PLQY2H8rRoyvxjVx3zfw4vA4cvlKogyLNN&v=Yze693W4MaU) from Chris and Richard Wei presented at the TensorFlow Dev Summit 2018. + +[try! Swift San Jose](https://www.tryswift.co/events/2018/sanjose/) was announced, with a focus on Swift Evolution and all the other Swift open source projects. + +### Commits and pull requests + +[Greg Titus](https://github.com/gregomni) fixed a [compiler crash](https://github.com/apple/swift/pull/15488) that happened when a `case` statement had both `let` and `var` [bindings for the same name](https://bugs.swift.org/browse/SR-7261). + +[Stephen Canon](https://github.com/stephentyrone) merged a change to how `description` and `debugDescription` [display floating-point values](https://github.com/apple/swift/pull/15474). The diff is a fascinating read into a fast and simple algorithm, and be sure to check out the chart showing the performance gains! 😍 + +[Karoy Lorentey](https://github.com/lorentey) merged his pull request to add [conditional conformance to `Hashable` in more standard library types](https://github.com/apple/swift/pull/15382). Optionals, arrays, dictionaries, and ranges (among other types) can now participate in [synthesized `Hashable` conformance](https://forums.swift.org/t/amendment-se-0143-conditional-conformance-add-hashable-conformance-to-std-lib-types/11401). + +[Mark Lacey](https://github.com/rudkx) landed a change to [fix type checking going exponential](https://github.com/apple/swift/pull/15419) for tuple literals. One fewer case of Xcode complaining that a type check took too long? ⏱ + +[Michael Ilseman](https://github.com/milseman) added the [new `SmallString` type to the standard library](https://github.com/apple/swift/pull/14755). The type is supported on 64-bit architectures and offers optimizations specific for (you guessed it) small strings. + + +### Accepted proposals + +[SE-0192](https://github.com/apple/swift-evolution/blob/master/proposals/0192-non-exhaustive-enums.md): _Non-Exhaustive Enums_ is [out of re-review and has been accepted with revisions](https://forums.swift.org/t/se-0192-non-exhaustive-enums-review-2/11043/62). + +This proposal introduces _frozen_ vs _non-frozen_ enumerations, and the final revisions add the new `@unknown` attribute. + +[SE-0201](https://github.com/apple/swift-evolution/blob/master/proposals/0201-package-manager-local-dependencies.md): _Package Manager Local Dependencies_ by [Ankit Aggarwal](https://github.com/aciidb0mb3r) was [accepted](https://forums.swift.org/t/accepted-se-0201-package-manager-local-dependencies/11629). + +This proposal allows you to declare a package dependency via a local path rather than a remote URL. + + +### Returned proposals + +[SE-0200](https://github.com/apple/swift-evolution/blob/master/proposals/0200-raw-string-escaping.md): _"Raw" mode string literals_ by [John Holdsworth](https://github.com/johnno1962) was [returned for revision](https://forums.swift.org/t/returned-for-revision-se-0200-raw-mode-string-literals/11630). + +This proposal had a ton of discussion in the thread. The two main reasons for returning the proposal for revision were: + +> - The proposed `r"..."` syntax didn’t fit well with the rest of the language. +> - The proposal itself leans heavily on regular expressions as a use case for raw string literals... a revised proposal will need additional motivating examples in other domains. + + +### Proposals in review + +[SE-0202](https://github.com/apple/swift-evolution/blob/master/proposals/0202-random-unification.md): _Random Unification_ by [Alejandro Alonso](https://github.com/Azoy) is just out of review, [awaiting results](https://forums.swift.org/t/se-0202-random-unification/11313). + +This proposal adds `random()` static function to numeric types and collections, a `shuffled()` method to sequences, as well as a `shuffle()` method to mutable collections. + + +[SE-0203](https://github.com/apple/swift-evolution/blob/master/proposals/0203-rename-sequence-elements-equal.md): _Rename Sequence.elementsEqual_ by [Xiaodi Wu](https://github.com/xwu) is [in review](https://forums.swift.org/t/se-0203-rename-sequence-elementsequal/11482). + +This proposal would remove a point of confusion where `==` and `elementsEqual(_:)` could return different results. + +> Having surveyed alternative solutions to this problem, it is proposed that the method be renamed to `Sequence.elementsEqualInIterationOrder`. + + +[SE-0204](https://github.com/apple/swift-evolution/blob/master/proposals/0204-add-last-methods.md): _Add last(where:) and lastIndex(where:) Methods_ by [Nate Cook](https://github.com/natecook1000) is [in review](https://forums.swift.org/t/se-0204-add-last-where-and-lastindex-where-methods/11486). + +We already have methods `first(where:)` and `index(where:)`, and this proposal would add similar methods to search from the end rather than from the beginning. + + +[SE-0206](https://github.com/apple/swift-evolution/blob/78332d211d00abac286c47609ce1a88a03c6e9bf/proposals/0206-hashable-enhancements.md): _Hashable Enhancements_ by Karoy Lorentey and Vincent Esche is [in review until April 13](https://forums.swift.org/t/se-0206-hashable-enhancements/11675). + +> This proposal introduces a new `Hasher` type representing the standard library's universal hash function, and it extends the `Hashable` protocol with a new `hash(into:)` requirement that expresses hashing in terms of `Hasher`. [...] Standardizing on a single, high-quality hash function greatly improves the reliability of `Set` and `Dictionary`. + +[SE-0207](https://github.com/apple/swift-evolution/blob/master/proposals/0207-containsOnly.md): *Add a `containsOnly` algorithm to `Sequence`* by Ben Cohen is [under review](https://forums.swift.org/t/se-0207-add-a-containsonly-algorithm-to-sequence/11686). + +> It is common to want to confirm that every element of a sequence equals a value, or matches a certain criteria. Many implementations of this can be found in use on GitHub. This proposal adds such a method to `Sequence`. + + +[Joe Groff](https://twitter.com/jckarter) [suggested a proposal to add `offset(of:)` to `MemoryLayout`](https://github.com/apple/swift-evolution/pull/818/files?diff=unified). + +> This proposal introduces the ability for Swift code to query the in-memory layout of stored properties in aggregates using key paths. +> +> `MemoryLayout.offset(of: \.origin.x) // => 0` +> +> `MemoryLayout.offset(of: \.origin.y) // => 8` + + +### Swift Forums + +[Soroush Khanlou](https://twitter.com/khanlou) [pitched an addition to `Sequence`](https://forums.swift.org/t/count-where-on-sequence/11186) to provide `count(where:)`: + +> While Swift’s Sequence models brings a lot of niceties that we didn’t have access to in Objective-C, like `map` and `filter`, there are other useful operations on Sequences that the standard library doesn’t support yet. I’d like to pitch one today: `count(where:)`, which counts the number of objects in a Sequence that passes some test. +> +> `[1, 2, 3, -1, -2].count(where: { $0 > 0 }) // => 3` + + +[Michael Ilseman](https://twitter.com/ilseman) wrote a pitch for [character and string properties](https://forums.swift.org/t/pitch-character-and-string-properties/11620). This would add support for some handy computed properties such as `isWhitespace` and `isAscii` on characters, and helper structs and methods on strings to split lines and words. + +Why not reach into string and character properties and do all this yourself? Short answer: Unicode is hard. 😓 + +> [There] is potential harm in developers reaching for these properties to solve common tasks without understanding their deep implications in Unicode. Whenever possible, we believe the best form of harm-reduction is providing more ergonomic APIs with more appropriate semantics for these common tasks. + + +A few weeks ago, [Graydon Hoare](https://twitter.com/graydon_pub) posted about the new [compiler batch mode](https://forums.swift.org/t/compilation-speed-help-test-batch-mode/10964) that could speed up your Swift compile times. The thread has a lot of real-world results from people trying things out on their own code bases; have a look if you’re interested in what might be coming up in future releases. + + +### O RLY? + +Finally: I can’t wait for `#error` and `#warning` to land in Swift 4.2, but in the meantime [at least there’s Swift support for `#lolcode`](https://github.com/CodaFi/swift/blob/72f19c9565ae7da1fe8bb7a4d02ff51cec9caa54/test/Interpreter/lolcode.swift). 😹 From b3815ff3cc408ed7780920b26b6994603462b58f Mon Sep 17 00:00:00 2001 From: Bas Broek Date: Thu, 5 Apr 2018 17:58:29 +0200 Subject: [PATCH 2/3] Delete 2018-04-05-issue-106.md --- _drafts/2018-04-05-issue-106.md | 142 -------------------------------- 1 file changed, 142 deletions(-) delete mode 100644 _drafts/2018-04-05-issue-106.md diff --git a/_drafts/2018-04-05-issue-106.md b/_drafts/2018-04-05-issue-106.md deleted file mode 100644 index c39cebbf..00000000 --- a/_drafts/2018-04-05-issue-106.md +++ /dev/null @@ -1,142 +0,0 @@ ---- -layout: post -title: ! 'Issue #106' -author: gregheo ---- - -> Lo! The forum posts and pitches fly on by
-> What rants and revelations there await?
-> Swift 5 remains a glimmer in the sky
-> As compactMap arrives to disorientate.
->
-> New Xcode versions, filled with all-new fix-its
-> And random numbers, ascribing golden tickets.
- -There’s been plenty of news to make developers experience the full range of emotions: [Xcode 9.3](https://developer.apple.com/news/releases/?id=03292018d) with [Swift 4.1](https://swift.org/blog/swift-4-1-released/) made it out of the gate, the WWDC ticket lottery smiled on some and caused gnashing of teeth in others. - -Meanwhile, Swift 4.2 and beyond await us. As a reminder, the final merge into the Swift 4.2 branch before a soak period is [coming up in two weeks, on April 20](https://swift.org/blog/4-2-release-process/). - -What’s new in the world of Swift? Read on! - - - - -### Starter tasks - -- [SR-7323](https://bugs.swift.org/browse/SR-7323): SPM can't handle spaces in path to Xcode -- [SR-7307](https://bugs.swift.org/browse/SR-7307): Warn when a block contains nothing but a defer statement -- [SR-7301](https://bugs.swift.org/browse/SR-7301): Bad fixit suggested for protocol extension implementation for inherited objc protocol -- [SR-7292](https://bugs.swift.org/browse/SR-7292): Swift local refactoring: adding field-wise initializers automatically -- [SR-7266](https://bugs.swift.org/browse/SR-7266): `reversed()` applied multiple times should not nest `ReversedCollection` into itself - -{% include task_remind.html %} - - -### Swift Unwrapped - -[Episode 51](https://spec.fm/podcasts/swift-unwrapped/125760) is the long-awaited Part 2 of Doug Gregor and Ben Cohen discussing Swift 4.1. - -In [Episode 52](https://spec.fm/podcasts/swift-unwrapped/129738), JP and Jesse cover two new pitches regarding Swift Package Manager. - - -### News and community - -Languages & Runtime manager [Ted Kremenek](https://twitter.com/tkremenek) shared photos of some [new office decorations over at Swift HQ](https://twitter.com/tkremenek/status/977268865066450944). 🤖 - -[Chris Lattner](https://twitter.com/clattner_llvm) announced [Swift for TensorFlow](https://groups.google.com/a/tensorflow.org/forum/#!topic/swift/xtXCEvtDe5Q), bringing first-class compiler and language support for the machine learning framework. Aside from the post, you can also check out [the video announcement](https://www.youtube.com/watch?list=PLQY2H8rRoyvxjVx3zfw4vA4cvlKogyLNN&v=Yze693W4MaU) from Chris and Richard Wei presented at the TensorFlow Dev Summit 2018. - -[try! Swift San Jose](https://www.tryswift.co/events/2018/sanjose/) was announced, with a focus on Swift Evolution and all the other Swift open source projects. - -### Commits and pull requests - -[Greg Titus](https://github.com/gregomni) fixed a [compiler crash](https://github.com/apple/swift/pull/15488) that happened when a `case` statement had both `let` and `var` [bindings for the same name](https://bugs.swift.org/browse/SR-7261). - -[Stephen Canon](https://github.com/stephentyrone) merged a change to how `description` and `debugDescription` [display floating-point values](https://github.com/apple/swift/pull/15474). The diff is a fascinating read into a fast and simple algorithm, and be sure to check out the chart showing the performance gains! 😍 - -[Karoy Lorentey](https://github.com/lorentey) merged his pull request to add [conditional conformance to `Hashable` in more standard library types](https://github.com/apple/swift/pull/15382). Optionals, arrays, dictionaries, and ranges (among other types) can now participate in [synthesized `Hashable` conformance](https://forums.swift.org/t/amendment-se-0143-conditional-conformance-add-hashable-conformance-to-std-lib-types/11401). - -[Mark Lacey](https://github.com/rudkx) landed a change to [fix type checking going exponential](https://github.com/apple/swift/pull/15419) for tuple literals. One fewer case of Xcode complaining that a type check took too long? ⏱ - -[Michael Ilseman](https://github.com/milseman) added the [new `SmallString` type to the standard library](https://github.com/apple/swift/pull/14755). The type is supported on 64-bit architectures and offers optimizations specific for (you guessed it) small strings. - - -### Accepted proposals - -[SE-0192](https://github.com/apple/swift-evolution/blob/master/proposals/0192-non-exhaustive-enums.md): _Non-Exhaustive Enums_ is [out of re-review and has been accepted with revisions](https://forums.swift.org/t/se-0192-non-exhaustive-enums-review-2/11043/62). - -This proposal introduces _frozen_ vs _non-frozen_ enumerations, and the final revisions add the new `@unknown` attribute. - -[SE-0201](https://github.com/apple/swift-evolution/blob/master/proposals/0201-package-manager-local-dependencies.md): _Package Manager Local Dependencies_ by [Ankit Aggarwal](https://github.com/aciidb0mb3r) was [accepted](https://forums.swift.org/t/accepted-se-0201-package-manager-local-dependencies/11629). - -This proposal allows you to declare a package dependency via a local path rather than a remote URL. - - -### Returned proposals - -[SE-0200](https://github.com/apple/swift-evolution/blob/master/proposals/0200-raw-string-escaping.md): _"Raw" mode string literals_ by [John Holdsworth](https://github.com/johnno1962) was [returned for revision](https://forums.swift.org/t/returned-for-revision-se-0200-raw-mode-string-literals/11630). - -This proposal had a ton of discussion in the thread. The two main reasons for returning the proposal for revision were: - -> - The proposed `r"..."` syntax didn’t fit well with the rest of the language. -> - The proposal itself leans heavily on regular expressions as a use case for raw string literals... a revised proposal will need additional motivating examples in other domains. - - -### Proposals in review - -[SE-0202](https://github.com/apple/swift-evolution/blob/master/proposals/0202-random-unification.md): _Random Unification_ by [Alejandro Alonso](https://github.com/Azoy) is just out of review, [awaiting results](https://forums.swift.org/t/se-0202-random-unification/11313). - -This proposal adds `random()` static function to numeric types and collections, a `shuffled()` method to sequences, as well as a `shuffle()` method to mutable collections. - - -[SE-0203](https://github.com/apple/swift-evolution/blob/master/proposals/0203-rename-sequence-elements-equal.md): _Rename Sequence.elementsEqual_ by [Xiaodi Wu](https://github.com/xwu) is [in review](https://forums.swift.org/t/se-0203-rename-sequence-elementsequal/11482). - -This proposal would remove a point of confusion where `==` and `elementsEqual(_:)` could return different results. - -> Having surveyed alternative solutions to this problem, it is proposed that the method be renamed to `Sequence.elementsEqualInIterationOrder`. - - -[SE-0204](https://github.com/apple/swift-evolution/blob/master/proposals/0204-add-last-methods.md): _Add last(where:) and lastIndex(where:) Methods_ by [Nate Cook](https://github.com/natecook1000) is [in review](https://forums.swift.org/t/se-0204-add-last-where-and-lastindex-where-methods/11486). - -We already have methods `first(where:)` and `index(where:)`, and this proposal would add similar methods to search from the end rather than from the beginning. - - -[SE-0206](https://github.com/apple/swift-evolution/blob/78332d211d00abac286c47609ce1a88a03c6e9bf/proposals/0206-hashable-enhancements.md): _Hashable Enhancements_ by Karoy Lorentey and Vincent Esche is [in review until April 13](https://forums.swift.org/t/se-0206-hashable-enhancements/11675). - -> This proposal introduces a new `Hasher` type representing the standard library's universal hash function, and it extends the `Hashable` protocol with a new `hash(into:)` requirement that expresses hashing in terms of `Hasher`. [...] Standardizing on a single, high-quality hash function greatly improves the reliability of `Set` and `Dictionary`. - -[SE-0207](https://github.com/apple/swift-evolution/blob/master/proposals/0207-containsOnly.md): *Add a `containsOnly` algorithm to `Sequence`* by Ben Cohen is [under review](https://forums.swift.org/t/se-0207-add-a-containsonly-algorithm-to-sequence/11686). - -> It is common to want to confirm that every element of a sequence equals a value, or matches a certain criteria. Many implementations of this can be found in use on GitHub. This proposal adds such a method to `Sequence`. - - -[Joe Groff](https://twitter.com/jckarter) [suggested a proposal to add `offset(of:)` to `MemoryLayout`](https://github.com/apple/swift-evolution/pull/818/files?diff=unified). - -> This proposal introduces the ability for Swift code to query the in-memory layout of stored properties in aggregates using key paths. -> -> `MemoryLayout.offset(of: \.origin.x) // => 0` -> -> `MemoryLayout.offset(of: \.origin.y) // => 8` - - -### Swift Forums - -[Soroush Khanlou](https://twitter.com/khanlou) [pitched an addition to `Sequence`](https://forums.swift.org/t/count-where-on-sequence/11186) to provide `count(where:)`: - -> While Swift’s Sequence models brings a lot of niceties that we didn’t have access to in Objective-C, like `map` and `filter`, there are other useful operations on Sequences that the standard library doesn’t support yet. I’d like to pitch one today: `count(where:)`, which counts the number of objects in a Sequence that passes some test. -> -> `[1, 2, 3, -1, -2].count(where: { $0 > 0 }) // => 3` - - -[Michael Ilseman](https://twitter.com/ilseman) wrote a pitch for [character and string properties](https://forums.swift.org/t/pitch-character-and-string-properties/11620). This would add support for some handy computed properties such as `isWhitespace` and `isAscii` on characters, and helper structs and methods on strings to split lines and words. - -Why not reach into string and character properties and do all this yourself? Short answer: Unicode is hard. 😓 - -> [There] is potential harm in developers reaching for these properties to solve common tasks without understanding their deep implications in Unicode. Whenever possible, we believe the best form of harm-reduction is providing more ergonomic APIs with more appropriate semantics for these common tasks. - - -A few weeks ago, [Graydon Hoare](https://twitter.com/graydon_pub) posted about the new [compiler batch mode](https://forums.swift.org/t/compilation-speed-help-test-batch-mode/10964) that could speed up your Swift compile times. The thread has a lot of real-world results from people trying things out on their own code bases; have a look if you’re interested in what might be coming up in future releases. - - -### O RLY? - -Finally: I can’t wait for `#error` and `#warning` to land in Swift 4.2, but in the meantime [at least there’s Swift support for `#lolcode`](https://github.com/CodaFi/swift/blob/72f19c9565ae7da1fe8bb7a4d02ff51cec9caa54/test/Interpreter/lolcode.swift). 😹 From 6650561a3350c8119b26acc208010f9d41a5cfbb Mon Sep 17 00:00:00 2001 From: Greg Heo Date: Thu, 5 Apr 2018 09:56:47 -0700 Subject: [PATCH 3/3] =?UTF-8?q?[106]=20Final=20final=20tweaks=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _posts/2018-04-05-issue-106.md | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/_posts/2018-04-05-issue-106.md b/_posts/2018-04-05-issue-106.md index c39cebbf..f527e08c 100644 --- a/_posts/2018-04-05-issue-106.md +++ b/_posts/2018-04-05-issue-106.md @@ -14,7 +14,7 @@ author: gregheo There’s been plenty of news to make developers experience the full range of emotions: [Xcode 9.3](https://developer.apple.com/news/releases/?id=03292018d) with [Swift 4.1](https://swift.org/blog/swift-4-1-released/) made it out of the gate, the WWDC ticket lottery smiled on some and caused gnashing of teeth in others. -Meanwhile, Swift 4.2 and beyond await us. As a reminder, the final merge into the Swift 4.2 branch before a soak period is [coming up in two weeks, on April 20](https://swift.org/blog/4-2-release-process/). +Meanwhile, Swift 4.2 and beyond await us. As a reminder, the final merge into the Swift 4.2 branch before the soak period is [coming up in two weeks, on April 20](https://swift.org/blog/4-2-release-process/). What’s new in the world of Swift? Read on! @@ -43,7 +43,7 @@ In [Episode 52](https://spec.fm/podcasts/swift-unwrapped/129738), JP and Jesse c Languages & Runtime manager [Ted Kremenek](https://twitter.com/tkremenek) shared photos of some [new office decorations over at Swift HQ](https://twitter.com/tkremenek/status/977268865066450944). 🤖 -[Chris Lattner](https://twitter.com/clattner_llvm) announced [Swift for TensorFlow](https://groups.google.com/a/tensorflow.org/forum/#!topic/swift/xtXCEvtDe5Q), bringing first-class compiler and language support for the machine learning framework. Aside from the post, you can also check out [the video announcement](https://www.youtube.com/watch?list=PLQY2H8rRoyvxjVx3zfw4vA4cvlKogyLNN&v=Yze693W4MaU) from Chris and Richard Wei presented at the TensorFlow Dev Summit 2018. +[Chris Lattner](https://twitter.com/clattner_llvm) announced [Swift for TensorFlow](https://groups.google.com/a/tensorflow.org/forum/#!topic/swift/xtXCEvtDe5Q), bringing first-class compiler and language support for the machine learning framework. Aside from the post, you can also [watch the video announcement](https://www.youtube.com/watch?list=PLQY2H8rRoyvxjVx3zfw4vA4cvlKogyLNN&v=Yze693W4MaU) presented at the TensorFlow Dev Summit 2018 by Chris and Richard Wei. [try! Swift San Jose](https://www.tryswift.co/events/2018/sanjose/) was announced, with a focus on Swift Evolution and all the other Swift open source projects. @@ -104,10 +104,24 @@ We already have methods `first(where:)` and `index(where:)`, and this proposal w > This proposal introduces a new `Hasher` type representing the standard library's universal hash function, and it extends the `Hashable` protocol with a new `hash(into:)` requirement that expresses hashing in terms of `Hasher`. [...] Standardizing on a single, high-quality hash function greatly improves the reliability of `Set` and `Dictionary`. + [SE-0207](https://github.com/apple/swift-evolution/blob/master/proposals/0207-containsOnly.md): *Add a `containsOnly` algorithm to `Sequence`* by Ben Cohen is [under review](https://forums.swift.org/t/se-0207-add-a-containsonly-algorithm-to-sequence/11686). > It is common to want to confirm that every element of a sequence equals a value, or matches a certain criteria. Many implementations of this can be found in use on GitHub. This proposal adds such a method to `Sequence`. +Instead of this: + +{% highlight swift %} +// every element is 9 +!nums.contains { $0 != 9 } +{% endhighlight %} + +You'll be able to do this: + +{% highlight swift %} +nums.containsOnly(9) +{% endhighlight %} + [Joe Groff](https://twitter.com/jckarter) [suggested a proposal to add `offset(of:)` to `MemoryLayout`](https://github.com/apple/swift-evolution/pull/818/files?diff=unified).