<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="">Agreed. This just reminds me of undefined vs null in Javascript and we all know how that ends.<br class=""><div class="">
<br class="Apple-interchange-newline"><span style="color: rgb(0, 0, 0); font-family: 'Lucida Grande'; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none;" class="">Félix</span>
</div>

<br class=""><div><blockquote type="cite" class=""><div class="">Le 7 janv. 2016 à 19:43:21, T.J. Usiyan via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; a écrit :</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">I am completely opposed to this change. We don't need a runtime checked nothing value.&nbsp; It is simple to explain that the default value of an optional is nil.</div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Thu, Jan 7, 2016 at 7:39 PM, Jack Lawrence 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"><div style="word-wrap:break-word" class="">I’m not sure I see how “none”–or the bifurcation it creates–captures intent any more clearly than “nil".<div class=""><br class=""></div><div class="">Jack<div class=""><div class="h5"><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Jan 7, 2016, at 4:19 PM, Amir Michail &lt;<a href="mailto:a.michail@me.com" target="_blank" class="">a.michail@me.com</a>&gt; wrote:</div><br class=""><div class=""><div style="word-wrap:break-word" class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Jan 7, 2016, at 7:09 PM, Jack Lawrence &lt;<a href="mailto:jackl@apple.com" target="_blank" class="">jackl@apple.com</a>&gt; wrote:</div><br class=""><div class=""><div style="word-wrap:break-word" class=""><blockquote type="cite" class=""><div class=""><div class="">Currently, “nil” can mean either “uninitialized” or “initialized to nil”, which can be confusing. What I propose is cleaner and eliminates the need for implicitly unwrapped optionals.</div></div></blockquote><div class=""><br class=""></div><div class="">`nil` always means “initialized to nil”. It never means “uninitialized”.</div></div></div></blockquote><div class=""><br class=""></div><div class="">The point is that “nil" doesn’t capture the programmer’s intent precisely. The intent could be to delay initialization (e.g., until viewDidLoad) or it could be to use nil as a special value (e.g., to indicate the end of a linked list).</div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap:break-word" class=""><br class=""><blockquote type="cite" class=""><div class=""><div class="">As I mentioned elsewhere, you could still use “!” in the type to indicate a variable that may be uninitialized but is not necessarily an optional, thus separating the concepts of uninitialized from “initialized to nil”.</div></div></blockquote><div class=""><br class=""></div>I’d be interested to see a real world code example where this language change is useful and as safe or safer than Optional/IUO.<div class=""><br class=""></div><div class="">Jack<br class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Jan 7, 2016, at 4:03 PM, Amir Michail via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class=""><div class=""><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class=""><blockquote type="cite" class=""><div class=""><br class="">On Jan 7, 2016, at 6:58 PM, Jarod Long &lt;<a href="mailto:swift@lng.la" target="_blank" class="">swift@lng.la</a>&gt; wrote:</div><br class=""><div class=""><div class=""><div name="messageBodySection" class="">The problem as I see it is that the functionality of none is already covered by optionals in a safer way. If something might be uninitialized, it really should be made explicit to the programmer so that they know to handle it properly. Implicitly-unwrapped optionals are already pretty generous in terms of allowing the programmer to ignore the possibility of a nil value, so it seems unnecessary to create a new feature to make it even easier.<br class=""><br class=""></div></div></div></blockquote><div class=""><br class=""></div><div class="">Currently, “nil” can mean either “uninitialized” or “initialized to nil”, which can be confusing. What I propose is cleaner and eliminates the need for implicitly unwrapped optionals.</div><div class=""><br class=""></div><div class="">As I mentioned elsewhere, you could still use “!” in the type to indicate a variable that may be uninitialized but is not necessarily an optional, thus separating the concepts of uninitialized from “initialized to nil”.</div><br class=""><blockquote type="cite" class=""><div class=""><div class=""><div name="messageBodySection" class="">Jarod</div><div name="messageSignatureSection" class=""><br class=""></div><div name="messageReplySection" class=""><br class="">On Jan 7, 2016, 15:44 -0800, Amir Michail &lt;<a href="mailto:a.michail@me.com" target="_blank" class="">a.michail@me.com</a>&gt;, wrote:<br class=""><blockquote type="cite" class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Jan 7, 2016, at 3:15 PM, Jarod Long &lt;<a href="mailto:jrd@lng.la" target="_blank" class="">jrd@lng.la</a>&gt; wrote:</div><br class=""><div class=""><div style="word-wrap:break-word" class=""><div class="">None is really just another way of saying something is nil, and a type suffix to allow assigning none is exactly equivalent to implicitly-unwrapped optionals, so I don't see any value in replacing them with this feature.</div></div></div></blockquote><div class=""><br class=""></div><div class="">“None" means a variable is uninitialized. “Nil" need not mean that.</div><div class=""><br class=""></div><div class="">Reading an uninitialized variable is an error. Reading a nil variable need not be.</div><div class=""><br class=""></div><div class="">With “none", you can have uninitialized variables without resorting to optionals or implicitly unwrapped optionals.</div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap:break-word" class=""><div class=""><br class=""></div><div class="">Not requiring a type suffix to assign none would be equivalent to allowing assignment of nil to any type, making everything an implicitly-unwrapped optional. You lose the compile-time nil safety that optionals provide, and the compiler likely loses many optimization opportunities because there are many situations where it can't know (or it is very difficult to know) whether a value could have possibly been assigned none at some point.</div><div class=""><br class=""></div><div class="">I understand the desire to reduce optionality to make code cleaner, but this kind of feature actually hides complexity and makes things more difficult in the long run. Implicitly-unwrapped optionals are a good compromise between cleanliness and effectively communicating when something can fail at run time.</div><div class=""><br class=""></div><div class="">Jarod</div><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Jan 7, 2016, at 11:41, Amir Michail via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class=""><div class=""><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class=""><br class=""><br class="">Sent from my iPad</div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class=""><br class="">On Jan 7, 2016, at 2:34 PM, Félix Cloutier &lt;<a href="mailto:felixcca@yahoo.ca" target="_blank" class="">felixcca@yahoo.ca</a>&gt; wrote:<br class=""><br class=""></div><blockquote type="cite" style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class=""><div class="">Yes, but following your suggestion, there may not be a difference between a non-optional value and an implicitly-wrapped optional, meaning that there will be a lot more of them.<br class=""></div></blockquote><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class=""><br class=""></div><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="">Variables that are never assigned "none" need not have these runtime checks. Alternatively, you can have a type suffix similar to ? to indicate that a variable may be in an uninitialized state.&nbsp;</div><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class=""><blockquote type="cite" style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class=""><div class=""><div class=""><br class=""><span style="font-family:'Lucida Grande';font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important" class="">Félix</span></div><br class=""><div class=""><blockquote type="cite" class=""><div class="">Le 7 janv. 2016 à 14:10:44, Amir Michail &lt;<a href="mailto:a.michail@me.com" target="_blank" class="">a.michail@me.com</a>&gt; a écrit :</div><br class=""><div class=""><div style="word-wrap:break-word" class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Jan 7, 2016, at 2:09 PM, Félix Cloutier &lt;<a href="mailto:felixcca@yahoo.ca" target="_blank" class="">felixcca@yahoo.ca</a>&gt; wrote:</div><br class=""><div class=""><div style="word-wrap:break-word" class="">That would leave you with runtime checks instead of compile-time checks and I totally disagree with that.<br class=""><div class=""><br class=""></div></div></div></blockquote><div class=""><br class=""></div><div class="">Implicitly unwrapped optionals do runtime checks also.</div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap:break-word" class=""><div class=""><span style="font-family:'Lucida Grande';font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important" class="">Félix</span></div><br class=""><div class=""><blockquote type="cite" class=""><div class="">Le 7 janv. 2016 à 13:45:21, Amir Michail &lt;<a href="mailto:a.michail@me.com" target="_blank" class="">a.michail@me.com</a>&gt; a écrit :</div><br class=""><div class=""><div style="word-wrap:break-word" class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Jan 7, 2016, at 1:40 PM, Félix Cloutier &lt;<a href="mailto:felixcca@yahoo.ca" target="_blank" class="">felixcca@yahoo.ca</a>&gt; wrote:</div><br class=""><div class=""><div style="word-wrap:break-word" class="">An implicitly-unwrapped optional would do almost that, no?<br class=""><div class=""><br class=""></div></div></div></blockquote><div class=""><br class=""></div><div class="">You can use “none” to eliminate implicitly unwrapped optionals from the language.</div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap:break-word" class=""><div class=""><span style="font-family:'Lucida Grande';font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important" class="">Félix</span></div><br class=""><div class=""><blockquote type="cite" class=""><div class="">Le 7 janv. 2016 à 12:46:53, Amir Michail via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>&gt; a écrit :</div><br class=""><div class=""><div class="">Examples:<br class=""><br class="">var x:Int = none // uninitialized but not an optional<br class=""><br class="">print(x) // run-time error as x is uninitialized<br class=""><br class="">if x == nil { … } // compile time error… x can never be nil because it is not an optional<br class=""><br class="">if x == none { x = 2 } // … but it can be uninitialized<br class=""><br class="">Optionals can also be uninitialized:<br class=""><br class="">var y:Int? = none // uninitialized and an optional<br class=""><br class="">if y == nil { … } // run-time error as y is uninitialized<br class=""><br class="">y = nil<br class=""><br class="">if y == nil { … } // fine<br class=""><br class="">_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" 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></div></blockquote></div><br class=""></div></div></blockquote></div><br class=""></div></div></blockquote></div><br class=""></div></blockquote><img src="https://u2002410.ct.sendgrid.net/wf/open?upn=8K1sNvSH2KR-2BkHEodrUTpf34ATsvtwNhFabfhxmB11RfPZORvm3qiYpH119HK-2BtUiKmVo0e7KNU0BkWmEMqCovcmHjrvs0Qr0Rsz4EPHpW-2FDqGL1fhfF6z4nwardSGPcsABLTL5X4OVmZi5HatJF0uAUBItCH2t-2F95hCWoWgpns8ziSfO009LCDjv-2FCTKoc1c-2FtEX-2B1x8aysOV-2BCVkUDig-3D-3D" alt="" width="1" height="1" border="0" style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;min-height:1px!important;width:1px!important;border-width:0px!important;margin:0px!important;padding:0px!important" class=""><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important" class=""><span class="">&nbsp;</span></span><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important" class="">_______________________________________________</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class=""><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important" class="">swift-evolution mailing list</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class=""><a href="mailto:swift-evolution@swift.org" style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" target="_blank" class="">swift-evolution@swift.org</a><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a></div></blockquote></div><br class=""></div></div></blockquote></div><br class=""></blockquote></div></div></div></blockquote></div><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class=""><img src="https://u2002410.ct.sendgrid.net/wf/open?upn=fPHCHxM8OEqkFI0LoY8YMuXDKRTx6ILsXcJMmyHEOCLGqB2vvc6d6GLPQq9S4-2BYrqAW-2FwZV9uAzcDsXUjyCjcdz7YB93iQ2sJ1qQnCdMCN9DLy8LxHpovUoE5Udg8OBogs3afQBB38VwymOffCvaus3s5x-2BAZ7-2FAB0GW8PYs7Z5Oce3RsVhqGRawj9zZw8COox-2BfI8BA1A8306jSP20wdx3lHcV3rw3e5qNUgaw6RLY-3D" alt="" width="1" height="1" border="0" style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;min-height:1px!important;width:1px!important;border-width:0px!important;margin:0px!important;padding:0px!important" class=""><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important" class=""><span class="">&nbsp;</span></span><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important" class="">_______________________________________________</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class=""><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important" class="">swift-evolution mailing list</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class=""><a href="mailto:swift-evolution@swift.org" style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" target="_blank" class="">swift-evolution@swift.org</a><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a></div></blockquote></div><br class=""></div></div></div></blockquote></div><br class=""></div></div></blockquote></div><br class=""></div></div></div>
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=3FGfocPbgxkNkmje7djckg9Iw-2BGYY3X6RxJ1tkUXKCrfbGnGj6zTxvU4Mg54ukZ6EvdZUBLQWEhLFwx-2B11ytRUG-2FZ-2BEnUlksWlevgVbF3L3FSCEbf-2FZ-2Fp-2BBcoCRpV4jiarDYdB8iavmQ0bgZZ5GJYYX4rO4s-2B4vpDWlP2dzexe8m8EN1XpFYWZWlhclpHRpVJWMBZC2PVBH1JVL-2Bsiq1Tl6t0HmIXsW7C2nhqBJMC9M-3D" alt="" width="1" height="1" border="0" style="min-height:1px!important;width:1px!important;border-width:0!important;margin-top:0!important;margin-bottom:0!important;margin-right:0!important;margin-left:0!important;padding-top:0!important;padding-bottom:0!important;padding-right:0!important;padding-left:0!important" class="">
</div>
<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="">
<br class=""></blockquote></div><br class=""></div>
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=iRI3beHTe3UxYAHTlV3lA38zIPfHMhyuRzgTmGKV6k6gHUabsO0S6Zauhm1Rq-2F0MAFE6gpTN0nJMW4o-2BnxDjvcdUdaHP6WAPwjVu4Siz4JjigicOJbRbS4kdG-2Fi0aE0L-2Ffyd9JEcTFRMLgr8t-2Fhk4dKrp-2FbWljGbiRmoV7au81KkvnxoseoXjjgVtDeptZbMRg9Agtli70-2FDBmpY3Q8OgSJYPE98F1OyglR-2FQdKA-2BvU-3D" alt="" width="1" height="1" border="0" style="height:1px !important;width:1px !important;border-width:0 !important;margin-top:0 !important;margin-bottom:0 !important;margin-right:0 !important;margin-left:0 !important;padding-top:0 !important;padding-bottom:0 !important;padding-right:0 !important;padding-left:0 !important;" class="">
_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></blockquote></div><br class=""></body></html>