<div style="white-space:pre-wrap">I also think that the existing syntax is perfect. The fact that it's about optionals and not Boolean values is the whole purpose of the operator, and it feels very natural.</div><br><div class="gmail_quote"><div dir="ltr">On Sat, Jan 30, 2016 at 12:28 PM Amir Michail 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 style="word-wrap:break-word"><div><blockquote type="cite"><div>On Jan 30, 2016, at 11:31 AM, Thorsten Seitz <<a href="mailto:tseitz42@icloud.com" target="_blank">tseitz42@icloud.com</a>> wrote:</div><br><div><blockquote type="cite" style="font-family:Helvetica;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br>Am 26.01.2016 um 03:30 schrieb Amir Michail via swift-evolution <<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>>:<br><br><br><blockquote type="cite">On Jan 25, 2016, at 9:28 PM, Erica Sadun <<a href="mailto:erica@ericasadun.com" target="_blank">erica@ericasadun.com</a>> wrote:<br><br>Not loving this. I'm quite happy with ??-coalescing and don't see<br>a compelling reason it needs to be "cleaner". I find your suggested<br>enhancement less readable. Looks like an optional chaining across<span> </span><br>a function.<br><br></blockquote><br>?? puts the least important part of the expression in the most important position — namely, the end.<br></blockquote><br style="font-family:Helvetica;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br style="font-family:Helvetica;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="font-family:Helvetica;font-size:14px;font-style:normal;font-variant: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">I think that’s actually a very good place as it is the option that is considered last.</span><br style="font-family:Helvetica;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"></div></blockquote><div><br></div></div></div><div style="word-wrap:break-word"><div><div>After thinking about it some more, it’s not really the position that is the problem.</div><div><br></div><div>I think the problems with ?? are as follows:</div><div><br></div><div>* not specialized to a boolean context (i.e, it is too general for most cases)</div><div>* “??" is too catchy for something this minor</div><div>* true/false contain too many letters for something this minor</div><div><br></div><div>I would like to type something like this:</div><div><br></div><div>if x?.isEmpty || nil { … }</div><div>if x?.isNotEmpty && !nil { … }</div><div><br></div><div>So one might consider turning “|| nil” into a suffix, say |nil.</div><div>Similarly, one might consider turning “&& !nil” into a suffix, say &!nil.</div><div><br></div><div>So maybe:</div><div><br></div><div><div>if x?.isEmpty |nil { … }</div><div>if x?.isNotEmpty &!nil { … }</div><div><br></div></div></div></div><div style="word-wrap:break-word"><div><br><blockquote type="cite"><div><br style="font-family:Helvetica;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="font-family:Helvetica;font-size:14px;font-style:normal;font-variant: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">-Thorsten</span><br style="font-family:Helvetica;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br style="font-family:Helvetica;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br style="font-family:Helvetica;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><blockquote type="cite" style="font-family:Helvetica;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br><blockquote type="cite">-- E<br><br><blockquote type="cite">On Jan 25, 2016, at 7:03 PM, Amir Michail via swift-evolution <<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>> wrote:<br><br>Examples:<br><br>* instead of x ?? false, you would have x?(false)<br>* instead of x?.isEmpty ?? false, you would have x?(false).isEmpty<br><br>I think this change would result in cleaner looking code.<br><br><br>_______________________________________________<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" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br></blockquote><br></blockquote><br>_______________________________________________<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" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a></blockquote></div></blockquote></div></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>