<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=""><br class=""><div><blockquote type="cite" class=""><div class="">On Nov 8, 2016, at 1:07 PM, Anton Zhilin via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="markdown-here-wrapper" style=""><p style="margin:0px 0px 1.2em!important" class="">2016-11-08 23:53 GMT+03:00 Pyry Jahkola <<a href="mailto:pyry.jahkola@iki.fi" target="_blank" class="">pyry.jahkola@iki.fi</a>>:</p><div style="margin: 0px 0px 1.2em !important;" class=""><br class="webkit-block-placeholder"></div><div class="markdown-here-exclude"><div class=""><br class="webkit-block-placeholder"></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto" class=""><div class="">Then why not just:<br class=""></div><div class=""><br class=""></div><div class=""> public protocol ExpressibleByIntLiteral {</div><div class=""> static var `nil`: Self</div><div class=""> }</div><div class=""><br class=""></div><div class="">…such that Foo.nil creates your nil value of type Foo?</div></div></blockquote><div class=""><br class="webkit-block-placeholder"></div></div><div style="margin: 0px 0px 1.2em !important;" class=""><br class="webkit-block-placeholder"></div><p style="margin:0px 0px 1.2em!important" class="">This proposal is not about creating an alternate syntax for <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline" class="">nil as Optional<Foo></code>. It’s about granting <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline" class="">nil</code> literal its own type:</p>
<pre style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;font-size:1em;line-height:1.2em;margin:1.2em 0px" class=""><code class="language-swift hljs" style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline;white-space:pre;overflow:auto;border-radius:3px;border:1px solid rgb(204,204,204);padding:0.5em 0.7em;display:block!important;display:block;overflow-x:auto;padding:0.5em;color:rgb(51,51,51);background:rgb(248,248,248)"><span class="hljs-keyword" style="color:rgb(51,51,51);font-weight:bold">let</span> a = <span class="hljs-built_in" style="color:rgb(0,134,179)">nil</span>
<span class="hljs-built_in" style="color:rgb(0,134,179)">print</span>(type(of: a)) <span class="hljs-comment" style="color:rgb(153,153,136);font-style:italic">//=> Nil</span>
</code></pre>
<div title="MDH:PGRpdiBjbGFzcz0iZ21haWxfZXh0cmEiPjxkaXYgY2xhc3M9ImdtYWlsX3F1b3RlIj4yMDE2LTEx
LTA4IDIzOjUzIEdNVCswMzowMCBQeXJ5IEphaGtvbGEgPHNwYW4gZGlyPSJsdHIiPiZsdDs8YSBo
cmVmPSJtYWlsdG86cHlyeS5qYWhrb2xhQGlraS5maSIgdGFyZ2V0PSJfYmxhbmsiPnB5cnkuamFo
a29sYUBpa2kuZmk8L2E+Jmd0Ozwvc3Bhbj46PGJyPjxibG9ja3F1b3RlIGNsYXNzPSJnbWFpbF9x
dW90ZSIgc3R5bGU9Im1hcmdpbjowIDAgMCAuOGV4O2JvcmRlci1sZWZ0OjFweCAjY2NjIHNvbGlk
O3BhZGRpbmctbGVmdDoxZXgiPjxkaXYgZGlyPSJhdXRvIj48ZGl2PlRoZW4gd2h5IG5vdCBqdXN0
Ojxicj48L2Rpdj48ZGl2Pjxicj48L2Rpdj48ZGl2PiZuYnNwOyAmbmJzcDsgcHVibGljIHByb3Rv
Y29sIEV4cHJlc3NpYmxlQnlJbnRMaXRlcmFsIHs8L2Rpdj48ZGl2PiZuYnNwOyAmbmJzcDsgJm5i
c3A7IHN0YXRpYyB2YXIgYG5pbGA6IFNlbGY8L2Rpdj48ZGl2PiZuYnNwOyAmbmJzcDsgfTwvZGl2
PjxkaXY+PGJyPjwvZGl2PjxkaXY+4oCmc3VjaCB0aGF0IEZvby5uaWwgY3JlYXRlcyB5b3VyIG5p
bCB2YWx1ZSBvZiB0eXBlIEZvbz88L2Rpdj48L2Rpdj48L2Jsb2NrcXVvdGU+PC9kaXY+PGJyPjwv
ZGl2PjxkaXYgY2xhc3M9ImdtYWlsX2V4dHJhIj5UaGlzIHByb3Bvc2FsIGlzIG5vdCBhYm91dCBj
cmVhdGluZyBhbiBhbHRlcm5hdGUgc3ludGF4IGZvciBgbmlsIGFzIE9wdGlvbmFsJmx0O0ZvbyZn
dDtgLiBJdCdzIGFib3V0IGdyYW50aW5nIGBuaWxgIGxpdGVyYWwgaXRzIG93biB0eXBlOjwvZGl2
PjxkaXYgY2xhc3M9ImdtYWlsX2V4dHJhIj48YnI+PC9kaXY+PGRpdiBjbGFzcz0iZ21haWxfZXh0
cmEiPmBgYHN3aWZ0PC9kaXY+PGRpdiBjbGFzcz0iZ21haWxfZXh0cmEiPmxldCBhID0gbmlsPC9k
aXY+PGRpdiBjbGFzcz0iZ21haWxfZXh0cmEiPnByaW50KHR5cGUob2Y6IGEpKSAmbmJzcDsvLz0m
Z3Q7IE5pbDwvZGl2PjxkaXYgY2xhc3M9ImdtYWlsX2V4dHJhIj5gYGA8L2Rpdj4=" style="height:0;width:0;max-height:0;max-width:0;overflow:hidden;font-size:0em;padding:0;margin:0" class=""></div></div></div></div></blockquote><br class=""></div><div>Is this desirable?</div><div><br class=""></div><div>John.</div><br class=""></body></html>