[swift-evolution] [Pitch] Introducing the "Unwrap or Die" operator to the standard library
Rien
Rien at Balancingrock.nl
Tue Jun 27 12:44:25 CDT 2017
I would not use it.
Somehow it gives me the creeps to leave something like ‘fatalError’ in a shipping application.
During development it could make sense, but then again I like to keep development and shipping the same as much as possible.
Regards,
Rien
Site: http://balancingrock.nl
Blog: http://swiftrien.blogspot.com
Github: http://github.com/Balancingrock
Project: http://swiftfire.nl - An HTTP(S) web server framework in Swift
> On 27 Jun 2017, at 19:16, Erica Sadun via swift-evolution <swift-evolution at swift.org> wrote:
>
> 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
>
> Thank you for your thoughtful feedback, -- E
>
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
More information about the swift-evolution
mailing list