<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Adding a Nil *type* is a bit different than casting dozen of identifiers to (void*)0...<div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jun 5, 2016, at 10:54 PM, T.J. Usiyan &lt;<a href="mailto:griotspeak@gmail.com" class="">griotspeak@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">*please* let us not repeat the mostly avoidable challenging-to-explain-to-newcomers-and-vetarans-alike situation that we had in Obj-C with regard to `nil`.<div class=""><br class=""></div><div class="">nil</div><div class="">Nil</div><div class="">NULL</div><div class="">NSNull</div><div class="">nullptr</div>kCFNull<div class="">__DARWIN_NULL</div><div class=""><br class=""></div><div class="">are the representations of 'don't have' that come to mind.&nbsp;</div><div class=""><br class=""></div><div class=""><br class=""></div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Sun, Jun 5, 2016 at 2:39 PM, Charlie Monroe via swift-evolution <span dir="ltr" class="">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>&gt;</span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">While None is probably the best way to describe the opposite of Any, it would be often mistaken for .None (i.e. Optional) by newcomers to the language.<br class="">
<br class="">
I'd personally prefer calling it "Nil" (capital N), which really means "nonexistent". The same way ObjC had "nil" for "id" and "Nil" for Class. Possibly, to avoid confusion with nil, calling it Null? Though that might get confused with NSNull, once the NS prefix gets dropped.<br class="">
<br class="">
Or "Nothing" as in Scala.<br class="">
<div class="HOEnZb"><div class="h5"><br class="">
&gt; On Jun 5, 2016, at 8:26 PM, Антон Жилин via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:<br class="">
&gt;<br class="">
&gt; The following names were suggested: NoReturn, Bottom, None, Never.<br class="">
&gt; I would pick None, because it looks like opposite to Any and fits nicely in generic types.<br class="">
&gt;<br class="">
&gt; I would prefer the type to be simple, and be implemented as a case-less enum (not a bottom value, as in Haskell).<br class="">
&gt;<br class="">
&gt; None should be a usual enum, with no compiler magic except that functions returning None are equivalent to current @noreturn.<br class="">
&gt;<br class="">
&gt; Example 1.<br class="">
&gt; let x: None?<br class="">
&gt; // ...<br class="">
&gt; let y = x!<br class="">
&gt;<br class="">
&gt; It will trap in runtime not because we discover scary bottom thing, as in Haskell, but because x had value Optional.none at that moment and we asserted otherwise.<br class="">
&gt; We could prove that it is always true in this case, but compiler must be stupid about this.<br class="">
&gt;<br class="">
&gt; Example 2.<br class="">
&gt; Compiler should allow including None in structures. Error will show up in constructor, when we will not be able to initialize the field.<br class="">
&gt;<br class="">
&gt; Example 3.<br class="">
&gt; None in an enum case makes that case never appear in values of such a type. But compiler can not know about that.<br class="">
&gt;<br class="">
&gt; - Anton<br class="">
</div></div><div class="HOEnZb"><div class="h5">&gt; _______________________________________________<br class="">
&gt; swift-evolution mailing list<br class="">
&gt; <a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">
&gt; <a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class="">
<br class="">
_______________________________________________<br class="">
swift-evolution mailing list<br class="">
<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class="">
</div></div></blockquote></div><br class=""></div>
</div></blockquote></div><br class=""></div></body></html>