<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div><blockquote type="cite" class=""><div class="">On Nov 2, 2017, at 7:05 PM, Xiaodi Wu 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=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Firstly, because for the proposed use case it's not a "default" parameter in that it's not overridable: you can't actually pass another argument.</span></div></blockquote></div><div class=""><br class=""></div><div class="">Sure you can. Remember, you can call an operator with function-call syntax:</div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>(+)(1, 2)</div><div class=""><br class=""></div><div class="">We could allow you to specify the non-default parameters when you need to using this syntax:</div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>// Normal use:</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>value !! MyError.missingValue</div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>// With defaulted parameters changed:</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>(!!)(value, MyError.missingValue, file: someFile, line: someLine)</div><div class=""><br class=""></div><div class="">We could also—as part of a separate proposal, perhaps in a future version of Swift—explore a more elegant syntax for adding options to operator calls. This could be useful for things like string comparisons where you need to decide whether a comparison should be locale-aware, case-sensitive, etc.</div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>// Strawman syntax of possible future expansion:</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>value !! MyError.missingValue #(file: someFile, line: someLine)</div><br class=""><div class="">
<span class="Apple-style-span" style="border-collapse: separate; font-variant-ligatures: normal; font-variant-east-asian: normal; font-variant-position: normal; line-height: normal; border-spacing: 0px;"><div class=""><div style="font-size: 12px; " class="">-- </div><div style="font-size: 12px; " class="">Brent Royal-Gordon</div><div style="font-size: 12px; " class="">Architechies</div></div></span>
</div>
<br class=""></body></html>