<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div><blockquote type="cite" class=""><div class="">On Sep 3, 2016, at 10:15 PM, Jacob Bandes-Storch &lt;<a href="mailto:jtbandes@gmail.com" class="">jtbandes@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Perhaps-conversely, what should this code do?<div class=""><br class=""></div><div class="">&nbsp; &nbsp; let nextIndex = foundIndex ?? lastIndex + 1</div><div class="gmail_extra"><br clear="all" class=""><div class=""><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr" class=""><div class="">Jacob<br class=""></div></div></div></div></div></div></div></blockquote><div><br class=""></div>It's a good counter example. And there's no optional-associative option.</div><div><br class=""></div><div>-- E</div><div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra">
<br class=""><div class="gmail_quote">On Sat, Sep 3, 2016 at 9:05 PM, Erica Sadun 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="">Given: `<font face="Menlo" class="">let x = Optional(3)</font>` then<blockquote style="margin:0 0 0 40px;border:none;padding:0px" class=""><div class=""><span style="font-family:Menlo" class="">`let y = 5 + x ?? 2` </span>will not compile</div></blockquote><div class="">but&nbsp;</div><blockquote style="margin:0 0 0 40px;border:none;padding:0px" class=""><div class=""><font face="Menlo" class="">`let y = 5 + (x ?? 2)`&nbsp;</font>will.</div></blockquote><div class=""><br class=""></div><div class="">Should <font face="Menlo" class="">NilCoalescingPrecedence</font> be raised? The current operator precedence chain is:</div><div class=""><br class=""></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px" class=""><div class=""><div class=""><font face="Menlo" class="">BitwiseShiftPrecedence &gt; MultiplicationPrecedence &gt; AdditionPrecedence &gt; RangeFormationPrecedence &gt; CastingPrecedence &gt; NilCoalescingPrecedence &gt; ComparisonPrecedence &gt; LogicalConjunctionPrecedence &gt; LogicalDisjunctionPrecedence &gt; TernaryPrecedence &gt; AssignmentPrecedence &gt; FunctionArrowPrecedence &gt; [nothing]</font></div></div></blockquote><div class=""><br class=""></div><div class="">It seems to me that `<font face="Menlo" class="">NilCoalescingPrecedence</font>` should probably be higher than `<font face="Menlo" class="">MultiplicationPrecedence</font>` and possibly higher `<font face="Menlo" class="">BitwiseShiftPrecedence</font>` as its job is to produce an unwrapped value that can then be operated upon.</div><div class=""><br class=""></div><div class="">I think <font face="Menlo" class="">CastingPrecedence</font> should be even higher because</div><blockquote style="margin:0 0 0 40px;border:none;padding:0px" class=""><div class=""><span style="font-family:Menlo" class="">`expression as? T ?? fallback value`</span></div></blockquote><div class="">should be parsed as</div><blockquote style="margin:0 0 0 40px;border:none;padding:0px" class=""><div class=""><span style="font-family:Menlo" class="">`(expression as? T) ?? (fallback value)`</span></div></blockquote><div class=""><br class=""></div><div class="">I apologize profusely because I know this is beyond last minute,</div><div class=""><br class=""></div><div class="">-- E</div><div class=""><br class=""></div></div><br class="">______________________________<wbr 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/<wbr class="">mailman/listinfo/swift-<wbr class="">evolution</a><br class="">
<br class=""></blockquote></div><br class=""></div></div>
</div></blockquote></div><br class=""></body></html>