[swift-evolution] [Discussion]: Deprecate !-Unwrapping of Optionals

Pierre Monod-Broca pierremonodbroca at gmail.com
Tue Mar 1 00:43:15 CST 2016


Proposal: -1
Chris: +1
Brent: +1
Charles: +1

And it's still better than the iconic NullPointerException, because it will mostly happen sooner, making it easier to understand

Pierre

> Le 1 mars 2016 à 06:58, Chris Lattner via swift-evolution <swift-evolution at swift.org> a écrit :
> 
> 
>> On Feb 29, 2016, at 4:04 PM, Developer via swift-evolution <swift-evolution at swift.org> wrote:
>> 
>> It is guarded in the same way that *(NULL) is guarded by an EXC_BAD_ACCESS.  It is all partiality in the end and beside the point I wished to make at the root of the discussion. 
> 
> Random ultra pedantic point, but dereferencing a null pointer in C (or an nil UnsafePointer in Swift) is actually undefined behavior, it is not guarded by a deterministic trap (as it is in Java).
> 
> Details here:
> http://blog.llvm.org/2011/05/what-every-c-programmer-should-know.html
> 
> -Chris
> _______________________________________________
> 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