<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>I'am not either for removing nil nor renaming it none, I think that they are conceptually different things.</div><div> </div><div>This syntactic sugar brings unfortunately many things around. One fastidious thing is it multiple semantics: As null pointer. As none value.</div><div>I am personally not favorable for multiples semantics keywords.</div><div><br></div><div>Aside, if it come up to revisiting nil concept we should bring the other chimera (unit, Void, bottom type etc).</div><div><br></div><div><div>--<div>J. Charles </div></div></div><div><br>Le 8 juin 2016 à 04:18, Muse M via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> a écrit :<br><br></div><blockquote type="cite"><div><div dir="ltr">None would be similar to Null or nothing about the types in that sense which None is not a type.<div>Nil would be interpret as Int, Float, String, etc<br><div><br></div><div><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jun 8, 2016 at 9:17 AM, Dany St-Amant via swift-evolution <span dir="ltr"><<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div>No clue as to the origins, but if you insist on using none. you can do:</div><div><br></div><div>let a : Int? = .none</div><div>let b : Int? = .some(5)</div><div><br></div><div>Using the simpler</div><div><br></div><div>let a : Int? = nil</div><div>let b : Int? = 5</div><div><br></div><div>is just sugar. </div><div>Maybe it was foresight to prevent people from saying, if I can do:</div><div><br></div><div>let a : Int? = none</div><div><br></div><div>Why can't I do:</div><div><br></div><div>let b : Int? = some(5)</div><div><br></div><div>And then go a step further by asking for all enum to be access without the leading dot; scary thought.</div><div><br></div><div>So it may be better to stick with '.none' and sugared 'nil'.</div><div><br></div><div>Dany</div><div><div class="h5"><div><div><br></div>Le 7 juin 2016 à 20:16, Brandon Knope via swift-evolution <<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>> a écrit :<br><br></div><blockquote type="cite"><div><div></div><div>That's exactly the point I was going for. </div><div><br></div><div>none makes more sense in this context than nil in my opinion</div><div><br></div><div>Brandon </div><div><br>On Jun 7, 2016, at 8:10 PM, Saagar Jha <<a href="mailto:saagarjha28@gmail.com" target="_blank">saagarjha28@gmail.com</a>> wrote:<br><br></div><blockquote type="cite"><div><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 <<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>> 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's not:</div><div><br></div><div>enum Optional<T> {</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 <<a href="mailto:jordan_rose@apple.com" target="_blank">jordan_rose@apple.com</a>> 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 <<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>> 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'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's a pointer </span><br></blockquote><blockquote type="cite"><span>4. Would nil be included if not for prior languages? Would "none" have been chosen as the keyword if nil wasn'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>
</div></blockquote></div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>swift-evolution mailing list</span><br><span><a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a></span><br><span><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span><br></div></blockquote></div></div></div><br>_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org">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>
<br></blockquote></div><br></div></div></div></div>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>swift-evolution mailing list</span><br><span><a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a></span><br><span><a href="https://lists.swift.org/mailman/listinfo/swift-evolution">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span><br></div></blockquote></body></html>