[swift-evolution] [Pitch] Introducing the "Unwrap or Die" operator to the standard library

Erica Sadun erica at ericasadun.com
Tue Jun 27 12:16:37 CDT 2017


Using an operator to provide feedback on the context of a failed unwrap has become a commonly implemented approach in the Swift developer Community. What are your thoughts about adopting this widely-used operator into the standard library?

guard !lastItem.isEmpty else { return }
let lastItem = array.last !! "Array must be non-empty"

Details here:  https://gist.github.com/erica/423e4b1c63b95c4c90338cdff4939a9b <https://gist.github.com/erica/423e4b1c63b95c4c90338cdff4939a9b>

Thank you for your thoughtful feedback, -- E

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170627/103e8526/attachment.html>


More information about the swift-evolution mailing list