[swift-evolution] Discussion: Why is "nil" not "none"

Brandon Knope bknope at me.com
Wed Jun 8 11:17:47 CDT 2016


I know I know. 

I should have framed this as removing NilLiteralConvertible from Optional and supplying it with a new keyword.

I don’t find nil to adequately represent what it is doing with optionals. It *looks* like it is setting a object to nil when this really isn’t the case. The optional is still very valid with a value of .none.

nil in swift is pretty different from nil in other languages. nil is mostly unsafe to access in other languages where in swift it is just a value representing no contained value.

nil in swift: safe to access. In other languages? Not so much (at least C / C++)

Brandon


> On Jun 8, 2016, at 11:51 AM, David Waite <david at alkaline-solutions.com> wrote:
> 
> i

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160608/345b4d79/attachment.html>


More information about the swift-evolution mailing list