<div dir="ltr">Well, some is the opposite of none in that if I don’t have some, I have none. nil is just a carry-over from Objective-C.</div><br><div class="gmail_quote"><div dir="ltr">On Tue, Jun 7, 2016 at 5:07 PM Brandon Knope via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div></div><div>I guess for me it comes down to this:</div><div><br></div><div><b>Why were some and none chosen for as the cases for Optional?</b></div><div><br></div><div>As an extension of that, why does nil then represent none instead of the obvious none?</div><div><br></div><div>There has to be a reason why it&#39;s not:</div><div><br></div><div>enum Optional&lt;T&gt; {</div><div>case some(T)</div><div>case nil</div><div>}</div><div><br></div><div>None seems a lot more expressive and consistent with Optional. </div><div><br></div><div>I am comfortable and use to nil, but with swift being a new language, I thought it was worth opening up a discussion about possibly changing direction a little here. </div><div><br></div><div>Thanks,</div><div>Brandon </div></div><div dir="auto"><div><br>On Jun 7, 2016, at 7:57 PM, Jordan Rose &lt;<a href="mailto:jordan_rose@apple.com" target="_blank">jordan_rose@apple.com</a>&gt; wrote:<br><br></div><blockquote type="cite"><div><span>There are NilLiteralConvertible types other than Optional, but they’re dwindling now that pointer nullability is represented by Optional. That said, I’m not convinced renaming “nil” is worth it at this point. Similarity with other languages is still a good thing.</span><br><span></span><br><span>It’s true that we might not have picked nil if it hadn’t been for Objective-C, but that doesn’t make it an invalid choice. There are lots of things in Swift we might have done differently if it weren’t for Objective-C and Cocoa.</span><br><span></span><br><span>Jordan</span><br><span></span><br><span></span><br><blockquote type="cite"><span>On Jun 5, 2016, at 12:35, Brandon Knope via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt; wrote:</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>Quick thought:</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>If optional has a .none case, wouldn&#39;t it be more consistent to rename nil to none?</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>Also, would nil make it into Swift if not for other languages?</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>It also might make it somewhat clearer:</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>var someInt: Int? = none //looks less like a pointer and more like a value of nothing </span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>1. It is more consistent with the optional enum</span><br></blockquote><blockquote type="cite"><span>2. The intent is arguably clearer</span><br></blockquote><blockquote type="cite"><span>3. nil makes it seem like it&#39;s a pointer </span><br></blockquote><blockquote type="cite"><span>4. Would nil be included if not for prior languages? Would &quot;none&quot; have been chosen as the keyword if nil wasn&#39;t prior art?</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>One disadvantage is how close it is to .none, but with how common nil/none is used, some syntactic sugar might make it look nicer than always having the stray .</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>On vacation from Orlando, poolside, with a quick thought,</span><br></blockquote><blockquote type="cite"><span>Brandon </span><br></blockquote><blockquote type="cite"><span>_______________________________________________</span><br></blockquote><blockquote type="cite"><span>swift-evolution mailing list</span><br></blockquote><blockquote type="cite"><span><a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a></span><br></blockquote><blockquote type="cite"><span><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span><br></blockquote><span></span><br></div></blockquote></div>_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
</blockquote></div><div dir="ltr">-- <br></div><div data-smartmail="gmail_signature"><div dir="ltr">-Saagar Jha</div></div>