<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="">Thank you for giving this a thought!<div class=""><br class=""></div><div class="">milos</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 7 Apr 2016, at 15:13, Erica Sadun <<a href="mailto:erica@ericasadun.com" class="">erica@ericasadun.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div style="font-family: -webkit-standard; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" class=""><div class=""><br class="Apple-interchange-newline">On Apr 6, 2016, at 10:13 AM, Milos Rankovic 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 class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Checking for divisibility is very common:<div class=""><br class=""></div><div class=""> <span class="" style="font-family: 'Source Code Pro'; font-size: 12px; color: rgb(255, 38, 0);">21</span><span class="" style="font-family: 'Source Code Pro'; font-size: 12px;"> % </span><span class="" style="font-family: 'Source Code Pro'; font-size: 12px; color: rgb(255, 38, 0);">3</span><span class="" style="font-family: 'Source Code Pro'; font-size: 12px;"> == </span><span class="" style="font-family: 'Source Code Pro'; font-size: 12px; color: rgb(255, 38, 0);">0</span><span class="" style="font-family: 'Source Code Pro'; font-size: 12px;"> </span><span class="" style="font-family: 'Source Code Pro'; font-size: 12px; color: rgb(203, 203, 203);">// true</span></div><div class=""><br class=""></div><div class="">In fact, this is such a common use of the `<span class="" style="font-family: 'Source Code Pro'; font-size: 12px;">%</span>` operator that the `<span class="" style="font-family: 'Source Code Pro'; font-size: 12px;">== </span><span class="" style="font-family: 'Source Code Pro'; font-size: 12px; color: rgb(255, 38, 0);">0</span>` side of the expression seems distracting in this use case. For quite a while now, I’ve been using a custom operator for this, which is steadily growing on me:</div><div class=""><br class=""></div><div class=""> <span class="" style="font-family: 'Source Code Pro'; font-size: 12px; color: rgb(255, 38, 0);">21</span><span class="" style="font-family: 'Source Code Pro'; font-size: 12px;"> </span><span class="" style="font-family: 'Source Code Pro'; font-size: 12px; color: rgb(145, 84, 15);">%==</span><span class="" style="font-family: 'Source Code Pro'; font-size: 12px;"> </span><span class="" style="font-family: 'Source Code Pro'; font-size: 12px; color: rgb(255, 38, 0);">3</span><span class="" style="font-family: 'Source Code Pro'; font-size: 12px;"> </span><span class="" style="color: rgb(203, 203, 203); font-family: 'Source Code Pro'; font-size: 12px;">// true</span></div><div class=""><br class=""></div><div class="">… which also allows me to overload it for sequences:</div><div class=""><br class=""></div><div class=""> <span class="" style="font-family: 'Source Code Pro'; font-size: 12px; color: rgb(255, 38, 0);">21</span><span class="" style="font-family: 'Source Code Pro'; font-size: 12px;"> </span><span class="" style="font-family: 'Source Code Pro'; font-size: 12px; color: rgb(145, 84, 15);">%==</span><span class="" style="font-family: 'Source Code Pro'; font-size: 12px;"> [</span><span class="" style="font-family: 'Source Code Pro'; font-size: 12px; color: rgb(255, 38, 0);">7</span><span class="" style="font-family: 'Source Code Pro'; font-size: 12px;">, </span><span class="" style="font-family: 'Source Code Pro'; font-size: 12px; color: rgb(255, 38, 0);">3</span><span class="" style="font-family: 'Source Code Pro'; font-size: 12px;">] </span><span class="" style="font-family: 'Source Code Pro'; font-size: 12px; color: rgb(203, 203, 203);">// true</span></div><div class=""><br class=""></div><div class="">(If I’m inadvertently misusing this mailing list to share such a minor idea, please tell me off so that I can learn not to do it again!)</div><div class=""><br class=""></div></div></div></blockquote><br class=""></div><div style="font-family: -webkit-standard; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">While modulo checks are common, I don't think that your proposed solution (%==) enhances readability or saves typing *<b class="">to such extent</b>* that it vastly improves over the existing art:</div><div style="font-family: -webkit-standard; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""></div><div style="font-family: -webkit-standard; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><font face="Menlo" class="">21 % 3 == 0</font><span class="Apple-converted-space"> </span>reads easily from left to right, is quick to type, is understood across many languages.</div><div style="font-family: -webkit-standard; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""></div><div style="font-family: -webkit-standard; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><font face="Menlo" class="">21 %== 3 </font> saves a few spaces, is less immediately understandable (due to the visual overlap with `+=` and `-=`) and would be (as far as I'm aware of) unique to Swift.</div><div style="font-family: -webkit-standard; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""></div><div style="font-family: -webkit-standard; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">I applaud the thinking and creativity but I would not support the proposal.</div><div style="font-family: -webkit-standard; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""></div><div style="font-family: -webkit-standard; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">-- E</div></div></blockquote></div><br class=""></div></body></html>