<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 Oct 3, 2017, at 4:05 PM, David Sweeris <<a href="mailto:davesweeris@mac.com" class="">davesweeris@mac.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Oct 2, 2017, at 10:06 PM, Chris Lattner <<a href="mailto:clattner@nondot.org" class="">clattner@nondot.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">On Oct 2, 2017, at 9:12 PM, David Sweeris via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:<div class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" 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;" class=""><div class="gmail_extra"><div class="gmail_quote"><div class="">Keep in mind that Swift already goes far above and beyond in terms of operators</div></div></div></div></div></blockquote>Yep, that's is a large part of why I'm such a Swift fan :-D</div></div></div></blockquote><div class=""><br class=""></div><div class="">Fortunately, no one is seriously proposing a major curtailing of the capabilities here, we’re just trying to rationalize the operator set, which is a bit of a mess at present.</div></div></div></div></blockquote><div class="">I guess I don't really understand why it's currently "a bit of a mess”.</div></div></div></div></blockquote><div><br class=""></div><div>Read the motivation/inconsistency section of:</div><div><a href="https://github.com/xwu/swift-evolution/blob/7c2c4df63b1d92a1677461f41bc638f31926c9c3/proposals/NNNN-refining-identifier-and-operator-symbology.md" class="">https://github.com/xwu/swift-evolution/blob/7c2c4df63b1d92a1677461f41bc638f31926c9c3/proposals/NNNN-refining-identifier-and-operator-symbology.md</a></div><div><br class=""></div><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Set algebra is an illustrative example, because it is both used by people who are experts and people who are not. As far as policies go, I think it makes sense for Swift libraries to define operator-like things as named functions (e.g. “intersection") and also define operators (“∩”) which can optionally be used in source bases that want them for convenience. The compiler and language cannot know whether a code base is written and maintained by experts who know the symbols and who value their clarity (over the difficulty typing and recognizing them), and this approach allows maintainers of the codebase to pick their own policies.</div></div></div></blockquote><div class="">Oh, yeah, I can't imagine a situation in which I'd think it'd be a good idea to not define a named function to go along with a unicode operator. I'm mainly concerned that we not limit the people in 5) unless we need to. And to be clear, if we actually need to, then I'm fine with doing that... It's just that -- like I said earlier in this message -- I don't clearly understand why this is a problem. </div></div></div></div></blockquote><div><br class=""></div><div>Sure, that’s fair. This is an issue we’ve been tracking since the Swift 2.x (!) days, so there is a lot of context that is probably not immediately obvious if you haven’t been following it since then. The proposal link above talks about the damage that we still carry.</div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">I do think that Ethan’s suggestion upthread interesting, which suggest considering something like:</div><div class=""> import matrixlib (operators: [ᵀ,·,⊗])</div><div class=""><br class=""></div><div class="">Three concerns I see:</div><div class=""> - Requiring them today would be a source incompatibility with Swift 4</div></div></div></blockquote><div class="">If we leave the current "import everything" behavior as the default, why would it be a source-breaking change? </div></div></div></div></blockquote><div><br class=""></div><div>It’s not clear to me that leaving that as the default would actually add anything useful, because if that is the default, noone will opt into typing more gunk into their code for no reason.</div><br class=""></div><div>-Chris</div><br class=""></body></html>