<div dir="ltr">As Stage 2 of Swift 4 evolution starts now, I'd like to share a revised proposal in draft form.<div><br></div><div>It proposes a source-breaking change for <b>rationalizing</b> which characters are permitted in identifiers and which in operators. It's justified for this phase of Swift 4 because:<div><br></div><div>- Existing grammar, in permitting invisible characters without security-minded restrictions, can be <i>actively harmful.</i></div><div>- A rationalized approach is <i>superior</i> to the current approach: by referencing Unicode standards, Swift should be able to evolve in a backwards-compatible way alongside Unicode, and will benefit from the significant expertise of others outside the Swift community with respect to Unicode best practices.</div><div>- The vast majority of existing code (including all of the standard library) should <i>require no migration</i> work at all</div><div><br></div><div><b>What's changed</b> since the last time:</div><div><br></div><div>- In an earlier draft, we proposed some radical changes to align with available Unicode standards; in particular, since emoji represent a difficult issue, and no recommendations about "operator identifiers" have surfaced from Unicode, we proposed temporarily stripping them out. This was <i>very poorly received</i>. This revision uses Unicode categories to identify nearly all emoji and classify them as identifier characters (while excluding those that depict operators such as !), and it uses Unicode categories to identify over 900 operators that nearly all pass the subjective test of "operator-likeness."</div><div><br></div><div>What this proposal <b>does not attempt</b> to do:</div><div><br></div><div>- This document <i>does not</i> seek to stake out new ground as to what characters should be <i>added</i> to the set of valid identifiers and operators. Such additions to the grammar are properly separate discussions. This proposal is only an attempt at systemization and rationalization. Only one character is incidentally added to the list of valid characters (`\`), and it is on the basis of an explicit table in Unicode Technical Report 25 regarding ASCII characters that are "mathematical."</div></div><div><br></div><div>What feedback would be<b> most helpful</b>:</div><div><br></div><div>- "Hey, this approach is so much more <b>clumsy</b> than my superior, more elegant category-based approach to identifying [operators/emoji], which is [insert here]."<br></div><div>- "Hey, I disagree with the detailed design because it's got a <b>major security hole</b>, which is [insert here]."</div><div>- "Hey, your proposal would break my <b>real-world</b> Swift code, which requires that character [X] be an [identifier/operator]."</div><div><br></div><div>What would be <b><i>less</i> helpful</b>:</div><div><br></div><div>- "Hey, let's talk about how [specific character] should be an [identifier/operator]. We should add that character to the list of [identifiers/operators]. In fact, let's discuss [list] characters one by one."</div><div><br></div><div>Acknowledgments:</div><div>Thanks to co-authors of the previous take for their support for resurrecting this issue. Any brilliant ideas are undoubtedly theirs, and any botched efforts are certainly mine. Thanks also to Nevin Brackett-Rozinsky for helpful feedback.</div><div><br></div><div>Link:</div><div><a href="https://gist.github.com/xwu/d2c2bb7097b0b5a4e9985aae737a2651">https://gist.github.com/xwu/d2c2bb7097b0b5a4e9985aae737a2651</a><br></div><div><br></div><div><br></div><div>Rendered text:</div><div><br></div><div><h1 style="box-sizing:border-box;margin:0px 0px 16px;line-height:1.25;padding-bottom:0.3em;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(238,238,238);color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol'">Refining identifier and operator symbology (take 2)</h1><ul style="box-sizing:border-box;padding-left:2em;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px"><li style="box-sizing:border-box">Proposal: <a href="https://gist.github.com/xwu/NNNN-refining-identifier-and-operator-symbology.md" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none">SE-NNNN</a></li><li style="box-sizing:border-box;margin-top:0.25em">Authors: <a href="https://github.com/xwu" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none">Xiaodi Wu</a>, <a href="https://github.com/jtbandes" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none">Jacob Bandes-Storch</a>, <a href="https://github.com/erica" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none">Erica Sadun</a>, Jonathan Shapiro, <a href="https://github.com/joaopinheiro" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none">João Pinheiro</a></li><li style="box-sizing:border-box;margin-top:0.25em">Review Manager: TBD</li><li style="box-sizing:border-box;margin-top:0.25em">Status: <span style="box-sizing:border-box;font-weight:600">Awaiting review</span></li></ul><h2 style="box-sizing:border-box;margin-top:24px;margin-bottom:16px;line-height:1.25;padding-bottom:0.3em;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(238,238,238);color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol'"><a id="gmail-user-content-introduction" class="gmail-anchor" href="https://gist.github.com/xwu/d2c2bb7097b0b5a4e9985aae737a2651#introduction" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none;float:left;padding-right:4px;line-height:1"></a>Introduction</h2><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px">This proposal refines and rationalizes Swift's identifier and operator symbology. Specifically, this proposal:</p><ul style="box-sizing:border-box;padding-left:2em;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px"><li style="box-sizing:border-box">refines the set of valid identifier characters based on Unicode recommendations, with customizations principally to accommodate emoji;</li><li style="box-sizing:border-box;margin-top:0.25em">refines the set of valid operator characters based on Unicode categories; and</li><li style="box-sizing:border-box;margin-top:0.25em">changes rules as to where dots may appear in operators.</li></ul><h3 style="box-sizing:border-box;margin-top:24px;margin-bottom:16px;font-size:1.25em;line-height:1.25;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol'"><a id="gmail-user-content-prior-discussion-threads-and-proposals" class="gmail-anchor" href="https://gist.github.com/xwu/d2c2bb7097b0b5a4e9985aae737a2651#prior-discussion-threads-and-proposals" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none;float:left;padding-right:4px;line-height:1"></a>Prior discussion threads and proposals</h3><ul style="box-sizing:border-box;padding-left:2em;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px"><li style="box-sizing:border-box"><a href="https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20170130/031461.html" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none">Define backslash '\' as a operator-head in the swift grammar</a></li><li style="box-sizing:border-box;margin-top:0.25em"><a href="https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20161017/028174.html" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none">Refining Identifier and Operator Symbology</a> (a precursor to this document)</li><li style="box-sizing:border-box;margin-top:0.25em"><a href="https://github.com/apple/swift-evolution/pull/531" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none">Proposal: Normalize Unicode identifiers</a></li><li style="box-sizing:border-box;margin-top:0.25em"><a href="https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20160926/027479.html" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none">Lexical matters: identifiers and operators</a></li><li style="box-sizing:border-box;margin-top:0.25em"><a href="https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20160912/027108.html" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none">Unicode identifiers & operators</a>, with <a href="https://gist.github.com/jtbandes/c0b0c072181dcd22c3147802025d0b59" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none">pre-proposal</a></li><li style="box-sizing:border-box;margin-top:0.25em"><a href="https://github.com/apple/swift-evolution/pull/354" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none">Proposal: Allow Single Dollar Sign as Valid Identifier</a></li><li style="box-sizing:border-box;margin-top:0.25em"><a href="https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20151228/005133.html" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none">Free the '$' Symbol!</a></li><li style="box-sizing:border-box;margin-top:0.25em"><a href="https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20151214/003176.html" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none">Request to add middle dot (U+00B7) as operator character?</a></li></ul><h2 style="box-sizing:border-box;margin-top:24px;margin-bottom:16px;line-height:1.25;padding-bottom:0.3em;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(238,238,238);color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol'"><a id="gmail-user-content-motivation" class="gmail-anchor" href="https://gist.github.com/xwu/d2c2bb7097b0b5a4e9985aae737a2651#motivation" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none;float:left;padding-right:4px;line-height:1"></a>Motivation</h2><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px">Swift supports programmers from many languages and cultures. However, the current identifier and operator character sets do not conform to any Unicode standards, nor have they been rationalized in the language or compiler documentation. These deserve a well-considered, standards-based revision.</p><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px">As Chris Lattner has written:</p><blockquote style="box-sizing:border-box;margin:0px 0px 16px;padding:0px 1em;color:rgb(119,119,119);border-left-width:0.25em;border-left-style:solid;border-left-color:rgb(221,221,221);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px"><p style="box-sizing:border-box;margin-top:0px;margin-bottom:0px">We need a token to be unambiguously an operator or identifier - we can have different rules for the leading and subsequent characters though.</p></blockquote><blockquote style="box-sizing:border-box;margin:0px 0px 16px;padding:0px 1em;color:rgb(119,119,119);border-left-width:0.25em;border-left-style:solid;border-left-color:rgb(221,221,221);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px"><p style="box-sizing:border-box;margin-top:0px;margin-bottom:0px">…our current operator space (particularly the Unicode segments covered) is not super well considered. It would be great for someone to take a more systematic pass over them to rationalize things.</p></blockquote><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px"><span style="box-sizing:border-box;font-weight:600">Identifiers</span>, which serve as <em style="box-sizing:border-box">names</em> for various entities, are linguistic in nature and must permit a variety of characters in order to properly serve non–English-speaking coders. This issue has been considered by the communities of many programming languages already, and the Unicode Consortium has published recommendations on how to choose identifier character sets. Swift should make an effort to conform to these recommendations.</p><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px"><span style="box-sizing:border-box;font-weight:600">Operators</span>, on the other hand, should be rare and carefully chosen because they suffer from limited discoverability and readability. They are by nature <em style="box-sizing:border-box">symbols</em>, not names. This places a cognitive cost on users with respect to recall ("What is the operator that applies the behavior I need?") and recognition ("What does the operator in this code do?"). While almost every non-trivial program defines new identifiers, most programs do not define new operators.</p><h3 style="box-sizing:border-box;margin-top:24px;margin-bottom:16px;font-size:1.25em;line-height:1.25;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol'"><a id="gmail-user-content-inconsistency" class="gmail-anchor" href="https://gist.github.com/xwu/d2c2bb7097b0b5a4e9985aae737a2651#inconsistency" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none;float:left;padding-right:4px;line-height:1"></a>Inconsistency</h3><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px">Concrete discrepancies and edge cases motivate these proposed changes. For example:</p><ul style="box-sizing:border-box;padding-left:2em;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px"><li style="box-sizing:border-box">The Greek question mark ; is a valid identifier.</li><li style="box-sizing:border-box;margin-top:0.25em">Some <em style="box-sizing:border-box">non-combining</em> diacritics ´ ¨ ꓻ are valid in identifiers.</li><li style="box-sizing:border-box;margin-top:0.25em">Braille patterns ⠟, which are letter-like, are operator characters.</li><li style="box-sizing:border-box;margin-top:0.25em">Other symbols such as ⚄ and ♄ are operator characters despite not being "operator-like."</li><li style="box-sizing:border-box;margin-top:0.25em">Currency symbols are split across operators (¢ £ ¤ ¥) and identifiers (₪ € ₱ ₹ ฿ ...).</li><li style="box-sizing:border-box;margin-top:0.25em"><span style="box-sizing:border-box;font-family:'apple color emoji','segoe ui','segoe ui emoji','segoe ui symbol';font-size:18px;line-height:20px;vertical-align:middle">🙂</span><span style="box-sizing:border-box;font-family:'apple color emoji','segoe ui','segoe ui emoji','segoe ui symbol';font-size:18px;line-height:20px;vertical-align:middle">🤘</span><span style="box-sizing:border-box;font-family:'apple color emoji','segoe ui','segoe ui emoji','segoe ui symbol';font-size:18px;line-height:20px;vertical-align:middle">▶️</span><span style="box-sizing:border-box;font-family:'apple color emoji','segoe ui','segoe ui emoji','segoe ui symbol';font-size:18px;line-height:20px;vertical-align:middle">🛩</span> are identifiers, while <span style="box-sizing:border-box;font-family:'apple color emoji','segoe ui','segoe ui emoji','segoe ui symbol';font-size:18px;line-height:20px;vertical-align:middle">☹️</span><span style="box-sizing:border-box;font-family:'apple color emoji','segoe ui','segoe ui emoji','segoe ui symbol';font-size:18px;line-height:20px;vertical-align:middle">✌️</span><span style="box-sizing:border-box;font-family:'apple color emoji','segoe ui','segoe ui emoji','segoe ui symbol';font-size:18px;line-height:20px;vertical-align:middle">🔼</span><span style="box-sizing:border-box;font-family:'apple color emoji','segoe ui','segoe ui emoji','segoe ui symbol';font-size:18px;line-height:20px;vertical-align:middle">✈️</span><span style="box-sizing:border-box;font-family:'apple color emoji','segoe ui','segoe ui emoji','segoe ui symbol';font-size:18px;line-height:20px;vertical-align:middle">♠️</span> are operators.</li><li style="box-sizing:border-box;margin-top:0.25em">A few characters 〡〢〣〤〥〦〧〨〩 〪 〫 〬 〭 〮 〯 are valid in <span style="box-sizing:border-box;font-weight:600">both</span> identifiers and operators.</li></ul><h3 style="box-sizing:border-box;margin-top:24px;margin-bottom:16px;font-size:1.25em;line-height:1.25;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol'"><a id="gmail-user-content-invisible-distinctions" class="gmail-anchor" href="https://gist.github.com/xwu/d2c2bb7097b0b5a4e9985aae737a2651#invisible-distinctions" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none;float:left;padding-right:4px;line-height:1"></a>Invisible distinctions</h3><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px">Identifiers that take advantage of Swift's Unicode support are not normalized. This allows different representations of the same characters to be considered distinct identifiers. For example:</p><pre style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;margin-top:0px;margin-bottom:16px;line-height:1.45;word-wrap:normal;padding:16px;overflow:auto;background-color:rgb(247,247,247);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;color:rgb(51,51,51)"><code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;padding:0px;margin:0px;background-color:transparent;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;word-break:normal;border:0px;display:inline;overflow:visible;line-height:inherit;word-wrap:normal">let Å = "Angstrom"
let Å = "Latin Capital Letter A With Ring Above"
let Å = "Latin Capital Letter A + Combining Ring Above"
</code></pre><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px">Non-printing characters such as ZERO WIDTH SPACE and ZERO WIDTH NON-JOINER are also accepted as valid identifier chracters without any restrictions.</p><pre style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;margin-top:0px;margin-bottom:16px;line-height:1.45;word-wrap:normal;padding:16px;overflow:auto;background-color:rgb(247,247,247);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;color:rgb(51,51,51)"><code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;padding:0px;margin:0px;background-color:transparent;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;word-break:normal;border:0px;display:inline;overflow:visible;line-height:inherit;word-wrap:normal">let ab = "ab"
let ab = "a + ZERO WIDTH SPACE + b"
func xy() { print("xy") }
func xy() { print("x + ZERO WIDTH NON-JOINER + y") }
</code></pre><h3 style="box-sizing:border-box;margin-top:24px;margin-bottom:16px;font-size:1.25em;line-height:1.25;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol'"><a id="gmail-user-content-timeline" class="gmail-anchor" href="https://gist.github.com/xwu/d2c2bb7097b0b5a4e9985aae737a2651#timeline" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none;float:left;padding-right:4px;line-height:1"></a>Timeline</h3><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px">These matters should be considered in a near timeframe (Swift 4). Identifier and operator character sets are fundamental parts of Swift grammar, and changes are inevitably source-breaking.</p><h3 style="box-sizing:border-box;margin-top:24px;margin-bottom:16px;font-size:1.25em;line-height:1.25;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol'"><a id="gmail-user-content-non-goals" class="gmail-anchor" href="https://gist.github.com/xwu/d2c2bb7097b0b5a4e9985aae737a2651#non-goals" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none;float:left;padding-right:4px;line-height:1"></a>Non-goals</h3><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px">The aim of this proposal is to rationalize the set of valid operator characters and the set of valid identifier characters using Unicode <span style="box-sizing:border-box;font-weight:600">categories</span> and specific Unicode <span style="box-sizing:border-box;font-weight:600">recommendations</span> where available. The smallest necessary customizations are made to increase backwards compatibility, but no attempt is made to expand Swift grammar or to "improve" Unicode. Specifically, the following questions are potential subjects of separate study, either within the purview of the Swift open source project or of the Unicode Consortium:</p><ul style="box-sizing:border-box;padding-left:2em;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px"><li style="box-sizing:border-box"><p style="box-sizing:border-box;margin-top:16px;margin-bottom:16px"><span style="box-sizing:border-box;font-weight:600">Expanding the set of valid operator or identifier characters.</span> For example, <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">$</code> is not currently a valid operator in Swift, there are no current Unicode recommendations regarding operators in programming languages, and <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">$</code> is not enumerated among the list of "mathematical" characters in Unicode. Although is possible for Swift to customize its implementation of Unicode recommendations to add <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">$</code> as a valid operator, that is an expansion of Swift grammar distinct from the task of rationalizing Swift symbology according to Unicode standards. Therefore, this document neither proposes nor opposes its addition. For similar reasons, this document refines the inclusion of emoji in identifiers based on Unicode categories, but it neither proposes nor opposes the inclusion of non-emoji pictographic symbols to the set of valid identifier characters.</p></li><li style="box-sizing:border-box;margin-top:0.25em"><p style="box-sizing:border-box;margin-top:16px;margin-bottom:16px"><span style="box-sizing:border-box;font-weight:600">Rectifying Unicode shortcomings.</span> Although it is possible to discover shortcomings concerning particular characters in the current version of Unicode, no attempt is made to preempt the Unicode standardization process by "patching" such issues in the Swift grammar. For example, in the current version of Unicode, ⁗ QUADRUPLE PRIME is not deemed to be "mathematical" (even though ‴ TRIPLE PRIME <em style="box-sizing:border-box">is</em> deemed to be "mathematical"). Certainly, this issue would be appropriate to report to Unicode and may well be corrected in a future revision of the standard. However, as the Swift community is not congruent with the community of experts that specialize in Unicode, there is no rational basis to expect that Swift-only determinations of what Unicode "should have done" (without vetting through Unicode's standardization processes) are likely to result in a better outcome than the existing Unicode standard. Therefore, no attempt is made to augment the Unicode derived category <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">Math</code> with ⁗ QUADRUPLE PRIME in this proposal. Similarly, Unicode recommends certain normalization forms for identifiers in code, which are proposed here for adoption by Swift, but these normalization forms do not eliminate all possible combinations of "confusable" characters. This proposal does not attempt to invent an ad-hoc normalization form in an attempt to "improve" Unicode recommendations.</p></li><li style="box-sizing:border-box;margin-top:0.25em"><p style="box-sizing:border-box;margin-top:16px;margin-bottom:16px"><span style="box-sizing:border-box;font-weight:600">Implementing additional features.</span> Innovative ideas such as <span style="box-sizing:border-box;font-weight:600">mixfix</span> operators are detailed below in <em style="box-sizing:border-box">Future directions</em>. This proposal does not attempt to introduce any such features.</p></li></ul><h2 style="box-sizing:border-box;margin-top:24px;margin-bottom:16px;line-height:1.25;padding-bottom:0.3em;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(238,238,238);color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol'"><a id="gmail-user-content-precedent-in-other-languages" class="gmail-anchor" href="https://gist.github.com/xwu/d2c2bb7097b0b5a4e9985aae737a2651#precedent-in-other-languages" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none;float:left;padding-right:4px;line-height:1"></a>Precedent in other languages</h2><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px"><span style="box-sizing:border-box;font-weight:600">Haskell</span> distinguishes identifiers/operators by their <a href="http://www.fileformat.info/info/unicode/category/index.htm" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none">general category</a> (for instance, "any Unicode lowercase letter" or "any Unicode symbol or punctuation"). Identifiers can start with any lowercase letter or <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">_</code>, and they may contain any letter, digit, <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">'</code>, or <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">_</code>. This includes letters like δ and Я, and digits like ٢.</p><ul style="box-sizing:border-box;padding-left:2em;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px"><li style="box-sizing:border-box"><a href="https://www.haskell.org/onlinereport/syntax-iso.html" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none">Haskell Syntax Reference</a></li><li style="box-sizing:border-box;margin-top:0.25em"><a href="https://github.com/ghc/ghc/blob/714bebff44076061d0a719c4eda2cfd213b7ac3d/compiler/parser/Lexer.x#L1949-L1973" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none">Haskell Lexer</a></li></ul><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px"><span style="box-sizing:border-box;font-weight:600">Scala</span> similarly allows letters, numbers, <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">$</code>, and <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">_</code> in identifiers, distinguishing by general categories <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">Ll</code>, <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">Lu</code>, <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">Lt</code>, <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">Lo</code>, and <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">Nl</code>. Operator characters include mathematical and other symbols (<code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">Sm</code> and <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">So</code>) in addition to certain ASCII characters.</p><ul style="box-sizing:border-box;padding-left:2em;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px"><li style="box-sizing:border-box"><a href="http://www.scala-lang.org/files/archive/spec/2.11/01-lexical-syntax.html#lexical-syntax" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none">Scala Lexical Syntax</a></li></ul><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px"><span style="box-sizing:border-box;font-weight:600">ECMAScript 2015</span> uses <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">ID_Start</code> and <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">ID_Continue</code>, as well as <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">Other_ID_Start</code> and <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">Other_ID_Continue</code>, for identifiers.</p><ul style="box-sizing:border-box;padding-left:2em;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px"><li style="box-sizing:border-box"><a href="http://www.ecma-international.org/ecma-262/6.0/#sec-names-and-keywords" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none">ECMAScript Specification: Names and Keywords</a></li></ul><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px"><span style="box-sizing:border-box;font-weight:600">Python 3</span> uses <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">XID_Start</code> and <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">XID_Continue</code>.</p><ul style="box-sizing:border-box;padding-left:2em;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px"><li style="box-sizing:border-box"><a href="https://docs.python.org/3/reference/lexical_analysis.html#grammar-token-identifier" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none">The Python Language Reference: Identifiers and Keywords</a></li><li style="box-sizing:border-box;margin-top:0.25em"><a href="https://www.python.org/dev/peps/pep-3131/" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none">PEP 3131: Supporting Non-ASCII Identifiers</a></li></ul><h2 style="box-sizing:border-box;margin-top:24px;margin-bottom:16px;line-height:1.25;padding-bottom:0.3em;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(238,238,238);color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol'"><a id="gmail-user-content-proposed-solution" class="gmail-anchor" href="https://gist.github.com/xwu/d2c2bb7097b0b5a4e9985aae737a2651#proposed-solution" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none;float:left;padding-right:4px;line-height:1"></a>Proposed solution</h2><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px"><span style="box-sizing:border-box;font-weight:600">Identifiers.</span> Adopt recommendations made in <a href="http://unicode.org/reports/tr31/" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none">UAX#31 Identifier and Pattern Syntax</a>, deriving the sets of valid identifier characters from <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">ID_Start</code> and <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">ID_Continue</code>. Adopt specific customizations principally to accommodate <span style="box-sizing:border-box;font-weight:600">emoji</span>. Consider two identifiers equivalent when they produce the same normalized form under <a href="http://unicode.org/reports/tr15/" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none">Normalization Form C (NFC)</a>, as recommended in UAX#31 for case-sensitive use cases.</p><table style="box-sizing:border-box;border-collapse:collapse;margin-top:0px;margin-bottom:16px;display:block;width:888px;overflow:auto;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px"><thead style="box-sizing:border-box"><tr style="box-sizing:border-box;border-top-width:1px;border-top-style:solid;border-top-color:rgb(204,204,204)"><th style="box-sizing:border-box;padding:6px 13px;border:1px solid rgb(221,221,221)"></th><th style="box-sizing:border-box;padding:6px 13px;border:1px solid rgb(221,221,221)">Is an identifier</th><th style="box-sizing:border-box;padding:6px 13px;border:1px solid rgb(221,221,221)">Is not an identifier</th></tr></thead><tbody style="box-sizing:border-box"><tr style="box-sizing:border-box;border-top-width:1px;border-top-style:solid;border-top-color:rgb(204,204,204)"><td style="box-sizing:border-box;padding:6px 13px;border:1px solid rgb(221,221,221)"><span style="box-sizing:border-box;font-weight:600">Shall be an identifier</span></td><td style="box-sizing:border-box;padding:6px 13px;border:1px solid rgb(221,221,221)"><a href="http://unicode.org/cldr/utility/list-unicodeset.jsp?a=%5B%5B%5Ba-zA-Z%0D%0A_%0D%0A%5Cu00A8%0D%0A%5Cu00AA%0D%0A%5Cu00AD%0D%0A%5Cu00AF%0D%0A%5Cu00B2-%5Cu00B5%0D%0A%5Cu00B7-%5Cu00BA%0D%0A%5Cu00BC-%5Cu00BE%0D%0A%5Cu00C0-%5Cu00D6%0D%0A%5Cu00D8-%5Cu00F6%0D%0A%5Cu00F8-%5Cu00FF%0D%0A%5Cu0100-%5Cu02FF%0D%0A%5Cu0370-%5Cu167F%0D%0A%5Cu1681-%5Cu180D%0D%0A%5Cu180F-%5Cu1DBF%0D%0A%5Cu1E00-%5Cu1FFF%0D%0A%5Cu200B-%5Cu200D%0D%0A%5Cu202A-%5Cu202E%0D%0A%5Cu203F-%5Cu2040%0D%0A%5Cu2054%0D%0A%5Cu2060-%5Cu206F%0D%0A%5Cu2070-%5Cu20CF%0D%0A%5Cu2100-%5Cu218F%0D%0A%5Cu2460-%5Cu24FF%0D%0A%5Cu2776-%5Cu2793%0D%0A%5Cu2C00-%5Cu2DFF%0D%0A%5Cu2E80-%5Cu2FFF%0D%0A%5Cu3004-%5Cu3007%0D%0A%5Cu3021-%5Cu302F%0D%0A%5Cu3031-%5Cu303F%0D%0A%5Cu3040-%5CuD7FF%0D%0A%5CuF900-%5CuFD3D%0D%0A%5CuFD40-%5CuFDCF%0D%0A%5CuFDF0-%5CuFE1F%0D%0A%5CuFE30-%5CuFE44%0D%0A%5CuFE47-%5CuFFFD%0D%0A%5CU00010000-%5CU0001FFFD%0D%0A%5CU00020000-%5CU0002FFFD%0D%0A%5CU00030000-%5CU0003FFFD%0D%0A%5CU00040000-%5CU0004FFFD%0D%0A%5CU00050000-%5CU0005FFFD%0D%0A%5CU00060000-%5CU0006FFFD%0D%0A%5CU00070000-%5CU0007FFFD%0D%0A%5CU00080000-%5CU0008FFFD%0D%0A%5CU00090000-%5CU0009FFFD%0D%0A%5CU000A0000-%5CU000AFFFD%0D%0A%5CU000B0000-%5CU000BFFFD%0D%0A%5CU000C0000-%5CU000CFFFD%0D%0A%5CU000D0000-%5CU000DFFFD%0D%0A%5CU000E0000-%5CU000EFFFD%5D%0D%0A%5B0-9%0D%0A%5Cu0300-%5Cu036F%0D%0A%5Cu1DC0-%5Cu1DFF%0D%0A%5Cu20D0-%5Cu20FF%0D%0A%5CuFE20-%5CuFE2F%5D%5D%0D%0A%26+%5B%5B%3AID_Continue%3A%5D%0D%0A_%0D%0A%5B%5B%3AEmoji_Presentation%3A%5D+-+%5B%3AEmoji_Defectives%3A%5D+-+%5B%3AID_Continue%3A%5D+-+%5B%3APattern_Syntax%3A%5D%5D%0D%0A%5B%5B%3AEmoji_Presentation%3A%5D+-+%5B%3AEmoji_Defectives%3A%5D+-+%5B%3AID_Continue%3A%5D+%26+%5B%3APattern_Syntax%3A%5D+%26+%5B%3ABlock%3DMiscellaneous+Symbols%3A%5D%5D%0D%0A%5B%5B%3AEmoji_Presentation%3A%5D+-+%5B%3AEmoji_Defectives%3A%5D+-+%5B%3AID_Continue%3A%5D+%26+%5B%3APattern_Syntax%3A%5D+%26+%5B%3ABlock%3DMiscellaneous+Technical%3A%5D%5D%0D%0A%5B%5B%3AEmoji%3A%5D+-+%5B%3AEmoji_Defectives%3A%5D+-+%5B%3AEmoji_Presentation%3A%5D+-+%5B%3AID_Continue%3A%5D+-+%5B%3APattern_Syntax%3A%5D%5D%0D%0A%5B%5B%3AEmoji%3A%5D+-+%5B%3AEmoji_Defectives%3A%5D+-+%5B%3AEmoji_Presentation%3A%5D+-+%5B%3AID_Continue%3A%5D+%26+%5B%3APattern_Syntax%3A%5D+%26+%5B%3ABlock%3DMiscellaneous+Symbols%3A%5D%5D%0D%0A%5B%5B%3AEmoji%3A%5D+-+%5B%3AEmoji_Defectives%3A%5D+-+%5B%3AEmoji_Presentation%3A%5D+-+%5B%3AID_Continue%3A%5D+%26+%5B%3APattern_Syntax%3A%5D+%26+%5B%3ABlock%3DMiscellaneous+Technical%3A%5D%5D%0D%0A%5B%5B%3AEmoji_Flag_Sequences%3A%5D+%5B%3AEmoji_Keycap_Sequences%3A%5D+%5B%3AEmoji_Modifier_Sequences%3A%5D%5D%5D%5D&g=&i=" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none">120,617 code points</a></td><td style="box-sizing:border-box;padding:6px 13px;border:1px solid rgb(221,221,221)"><a href="http://unicode.org/cldr/utility/list-unicodeset.jsp?a=%5B%5B%5B%3AID_Continue%3A%5D%0D%0A_%0D%0A%5B%5B%3AEmoji_Presentation%3A%5D+-+%5B%3AEmoji_Defectives%3A%5D+-+%5B%3AID_Continue%3A%5D+-+%5B%3APattern_Syntax%3A%5D%5D%0D%0A%5B%5B%3AEmoji_Presentation%3A%5D+-+%5B%3AEmoji_Defectives%3A%5D+-+%5B%3AID_Continue%3A%5D+%26+%5B%3APattern_Syntax%3A%5D+%26+%5B%3ABlock%3DMiscellaneous+Symbols%3A%5D%5D%0D%0A%5B%5B%3AEmoji_Presentation%3A%5D+-+%5B%3AEmoji_Defectives%3A%5D+-+%5B%3AID_Continue%3A%5D+%26+%5B%3APattern_Syntax%3A%5D+%26+%5B%3ABlock%3DMiscellaneous+Technical%3A%5D%5D%0D%0A%5B%5B%3AEmoji%3A%5D+-+%5B%3AEmoji_Defectives%3A%5D+-+%5B%3AEmoji_Presentation%3A%5D+-+%5B%3AID_Continue%3A%5D+-+%5B%3APattern_Syntax%3A%5D%5D%0D%0A%5B%5B%3AEmoji%3A%5D+-+%5B%3AEmoji_Defectives%3A%5D+-+%5B%3AEmoji_Presentation%3A%5D+-+%5B%3AID_Continue%3A%5D+%26+%5B%3APattern_Syntax%3A%5D+%26+%5B%3ABlock%3DMiscellaneous+Symbols%3A%5D%5D%0D%0A%5B%5B%3AEmoji%3A%5D+-+%5B%3AEmoji_Defectives%3A%5D+-+%5B%3AEmoji_Presentation%3A%5D+-+%5B%3AID_Continue%3A%5D+%26+%5B%3APattern_Syntax%3A%5D+%26+%5B%3ABlock%3DMiscellaneous+Technical%3A%5D%5D%0D%0A%5B%5B%3AEmoji_Flag_Sequences%3A%5D+%5B%3AEmoji_Keycap_Sequences%3A%5D+%5B%3AEmoji_Modifier_Sequences%3A%5D%5D%5D%0D%0A-%5B%5Ba-zA-Z%0D%0A_%0D%0A%5Cu00A8%0D%0A%5Cu00AA%0D%0A%5Cu00AD%0D%0A%5Cu00AF%0D%0A%5Cu00B2-%5Cu00B5%0D%0A%5Cu00B7-%5Cu00BA%0D%0A%5Cu00BC-%5Cu00BE%0D%0A%5Cu00C0-%5Cu00D6%0D%0A%5Cu00D8-%5Cu00F6%0D%0A%5Cu00F8-%5Cu00FF%0D%0A%5Cu0100-%5Cu02FF%0D%0A%5Cu0370-%5Cu167F%0D%0A%5Cu1681-%5Cu180D%0D%0A%5Cu180F-%5Cu1DBF%0D%0A%5Cu1E00-%5Cu1FFF%0D%0A%5Cu200B-%5Cu200D%0D%0A%5Cu202A-%5Cu202E%0D%0A%5Cu203F-%5Cu2040%0D%0A%5Cu2054%0D%0A%5Cu2060-%5Cu206F%0D%0A%5Cu2070-%5Cu20CF%0D%0A%5Cu2100-%5Cu218F%0D%0A%5Cu2460-%5Cu24FF%0D%0A%5Cu2776-%5Cu2793%0D%0A%5Cu2C00-%5Cu2DFF%0D%0A%5Cu2E80-%5Cu2FFF%0D%0A%5Cu3004-%5Cu3007%0D%0A%5Cu3021-%5Cu302F%0D%0A%5Cu3031-%5Cu303F%0D%0A%5Cu3040-%5CuD7FF%0D%0A%5CuF900-%5CuFD3D%0D%0A%5CuFD40-%5CuFDCF%0D%0A%5CuFDF0-%5CuFE1F%0D%0A%5CuFE30-%5CuFE44%0D%0A%5CuFE47-%5CuFFFD%0D%0A%5CU00010000-%5CU0001FFFD%0D%0A%5CU00020000-%5CU0002FFFD%0D%0A%5CU00030000-%5CU0003FFFD%0D%0A%5CU00040000-%5CU0004FFFD%0D%0A%5CU00050000-%5CU0005FFFD%0D%0A%5CU00060000-%5CU0006FFFD%0D%0A%5CU00070000-%5CU0007FFFD%0D%0A%5CU00080000-%5CU0008FFFD%0D%0A%5CU00090000-%5CU0009FFFD%0D%0A%5CU000A0000-%5CU000AFFFD%0D%0A%5CU000B0000-%5CU000BFFFD%0D%0A%5CU000C0000-%5CU000CFFFD%0D%0A%5CU000D0000-%5CU000DFFFD%0D%0A%5CU000E0000-%5CU000EFFFD%5D%0D%0A%5B0-9%0D%0A%5Cu0300-%5Cu036F%0D%0A%5Cu1DC0-%5Cu1DFF%0D%0A%5Cu20D0-%5Cu20FF%0D%0A%5CuFE20-%5CuFE2F%5D%5D%5D&g=&i=" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none">699 emoji</a></td></tr><tr style="box-sizing:border-box;background-color:rgb(248,248,248);border-top-width:1px;border-top-style:solid;border-top-color:rgb(204,204,204)"><td style="box-sizing:border-box;padding:6px 13px;border:1px solid rgb(221,221,221)"><span style="box-sizing:border-box;font-weight:600">Shall not be an identifier</span></td><td style="box-sizing:border-box;padding:6px 13px;border:1px solid rgb(221,221,221)"><a href="http://unicode.org/cldr/utility/list-unicodeset.jsp?a=%5B%5B%5Ba-zA-Z%0D%0A_%0D%0A%5Cu00A8%0D%0A%5Cu00AA%0D%0A%5Cu00AD%0D%0A%5Cu00AF%0D%0A%5Cu00B2-%5Cu00B5%0D%0A%5Cu00B7-%5Cu00BA%0D%0A%5Cu00BC-%5Cu00BE%0D%0A%5Cu00C0-%5Cu00D6%0D%0A%5Cu00D8-%5Cu00F6%0D%0A%5Cu00F8-%5Cu00FF%0D%0A%5Cu0100-%5Cu02FF%0D%0A%5Cu0370-%5Cu167F%0D%0A%5Cu1681-%5Cu180D%0D%0A%5Cu180F-%5Cu1DBF%0D%0A%5Cu1E00-%5Cu1FFF%0D%0A%5Cu200B-%5Cu200D%0D%0A%5Cu202A-%5Cu202E%0D%0A%5Cu203F-%5Cu2040%0D%0A%5Cu2054%0D%0A%5Cu2060-%5Cu206F%0D%0A%5Cu2070-%5Cu20CF%0D%0A%5Cu2100-%5Cu218F%0D%0A%5Cu2460-%5Cu24FF%0D%0A%5Cu2776-%5Cu2793%0D%0A%5Cu2C00-%5Cu2DFF%0D%0A%5Cu2E80-%5Cu2FFF%0D%0A%5Cu3004-%5Cu3007%0D%0A%5Cu3021-%5Cu302F%0D%0A%5Cu3031-%5Cu303F%0D%0A%5Cu3040-%5CuD7FF%0D%0A%5CuF900-%5CuFD3D%0D%0A%5CuFD40-%5CuFDCF%0D%0A%5CuFDF0-%5CuFE1F%0D%0A%5CuFE30-%5CuFE44%0D%0A%5CuFE47-%5CuFFFD%0D%0A%5CU00010000-%5CU0001FFFD%0D%0A%5CU00020000-%5CU0002FFFD%0D%0A%5CU00030000-%5CU0003FFFD%0D%0A%5CU00040000-%5CU0004FFFD%0D%0A%5CU00050000-%5CU0005FFFD%0D%0A%5CU00060000-%5CU0006FFFD%0D%0A%5CU00070000-%5CU0007FFFD%0D%0A%5CU00080000-%5CU0008FFFD%0D%0A%5CU00090000-%5CU0009FFFD%0D%0A%5CU000A0000-%5CU000AFFFD%0D%0A%5CU000B0000-%5CU000BFFFD%0D%0A%5CU000C0000-%5CU000CFFFD%0D%0A%5CU000D0000-%5CU000DFFFD%0D%0A%5CU000E0000-%5CU000EFFFD%5D%0D%0A%5B0-9%0D%0A%5Cu0300-%5Cu036F%0D%0A%5Cu1DC0-%5Cu1DFF%0D%0A%5Cu20D0-%5Cu20FF%0D%0A%5CuFE20-%5CuFE2F%5D%5D%0D%0A-%5B%5B%3AID_Continue%3A%5D%0D%0A_%0D%0A%5B%5B%3AEmoji_Presentation%3A%5D+-+%5B%3AEmoji_Defectives%3A%5D+-+%5B%3AID_Continue%3A%5D+-+%5B%3APattern_Syntax%3A%5D%5D%0D%0A%5B%5B%3AEmoji_Presentation%3A%5D+-+%5B%3AEmoji_Defectives%3A%5D+-+%5B%3AID_Continue%3A%5D+%26+%5B%3APattern_Syntax%3A%5D+%26+%5B%3ABlock%3DMiscellaneous+Symbols%3A%5D%5D%0D%0A%5B%5B%3AEmoji_Presentation%3A%5D+-+%5B%3AEmoji_Defectives%3A%5D+-+%5B%3AID_Continue%3A%5D+%26+%5B%3APattern_Syntax%3A%5D+%26+%5B%3ABlock%3DMiscellaneous+Technical%3A%5D%5D%0D%0A%5B%5B%3AEmoji%3A%5D+-+%5B%3AEmoji_Defectives%3A%5D+-+%5B%3AEmoji_Presentation%3A%5D+-+%5B%3AID_Continue%3A%5D+-+%5B%3APattern_Syntax%3A%5D%5D%0D%0A%5B%5B%3AEmoji%3A%5D+-+%5B%3AEmoji_Defectives%3A%5D+-+%5B%3AEmoji_Presentation%3A%5D+-+%5B%3AID_Continue%3A%5D+%26+%5B%3APattern_Syntax%3A%5D+%26+%5B%3ABlock%3DMiscellaneous+Symbols%3A%5D%5D%0D%0A%5B%5B%3AEmoji%3A%5D+-+%5B%3AEmoji_Defectives%3A%5D+-+%5B%3AEmoji_Presentation%3A%5D+-+%5B%3AID_Continue%3A%5D+%26+%5B%3APattern_Syntax%3A%5D+%26+%5B%3ABlock%3DMiscellaneous+Technical%3A%5D%5D%0D%0A%5B%5B%3AEmoji_Flag_Sequences%3A%5D+%5B%3AEmoji_Keycap_Sequences%3A%5D+%5B%3AEmoji_Modifier_Sequences%3A%5D%5D%5D%5D&g=&i=" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none">846,137 unassigned code points;<br style="box-sizing:border-box">4,929 other code points</a></td><td style="box-sizing:border-box;padding:6px 13px;border:1px solid rgb(221,221,221)"><em style="box-sizing:border-box">All other code points</em></td></tr></tbody></table><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px"><span style="box-sizing:border-box;font-weight:600">Operators.</span> No Unicode recommendation currently exists on the topic of "operator identifiers," although work is ongoing as part of a future update to UAX#31. The aim of the proposed definition presented in this document is to identify, using Unicode categories, a reasonable set of operators that (a) may be in current use in Swift code; and (b) are likely to be included in future versions of UAX#31. It is not intended to be a final judgment on all code points that should ever be valid in Swift operators, for which it is proposed that Swift await the recommendations of the Unicode Consortium.</p><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px">Therefore, adopt an approach to define the set of valid operator characters based primarily on the Unicode categories <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">Math</code> and <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">Pattern_Syntax</code> (an approach analogous to that which is used to define <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">ID_Start</code> and <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">ID_Continue</code> in Unicode recommendations), informed by <a href="http://www.unicode.org/reports/tr25/" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none">UAX#25 Unicode Support for Mathematics</a>. Augment the set of valid operator characters with a number of currently valid Swift operator characters to increase backward compatibility. Consider two operators equivalent when they produce the same normalized form under <a href="http://unicode.org/reports/tr15/" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none">Normalization Form KC (NFKC)</a>, as recommended in UAX#31 for case-insensitive use cases. Fullwidth variants such as FULLWIDTH HYPHEN-MINUS are equivalent to their non-fullwidth counterparts after normalization under NFKC (but not NFC).</p><table style="box-sizing:border-box;border-collapse:collapse;margin-top:0px;margin-bottom:16px;display:block;width:888px;overflow:auto;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px"><thead style="box-sizing:border-box"><tr style="box-sizing:border-box;border-top-width:1px;border-top-style:solid;border-top-color:rgb(204,204,204)"><th style="box-sizing:border-box;padding:6px 13px;border:1px solid rgb(221,221,221)"></th><th style="box-sizing:border-box;padding:6px 13px;border:1px solid rgb(221,221,221)">Is an operator</th><th style="box-sizing:border-box;padding:6px 13px;border:1px solid rgb(221,221,221)">Is not an operator</th></tr></thead><tbody style="box-sizing:border-box"><tr style="box-sizing:border-box;border-top-width:1px;border-top-style:solid;border-top-color:rgb(204,204,204)"><td style="box-sizing:border-box;padding:6px 13px;border:1px solid rgb(221,221,221)"><span style="box-sizing:border-box;font-weight:600">Shall be an operator</span></td><td style="box-sizing:border-box;padding:6px 13px;border:1px solid rgb(221,221,221)"><a href="http://unicode.org/cldr/utility/list-unicodeset.jsp?a=%5B%5b%5b%3aPattern%5fSyntax%3a%5d%20%26%20%5b%3aMath%3a%5d%0d%0a%2d%20%5b%3aBlock%3dGeometric%20Shapes%3a%5d%0d%0a%2d%20%5b%3aBlock%3dMiscellaneous%20Symbols%3a%5d%0d%0a%2d%20%5b%3aBlock%3dMiscellaneous%20Technical%3a%5d%0d%0a%5b%21%20%25%20%5c%26%20%2a%20%5c%2d%20%2f%20%3f%20%5c%5c%20%5c%5e%20%C2%A1%20%C2%A6%20%C2%A7%20%C2%B0%20%C2%B6%20%C2%BF%20%E2%80%A0%20%E2%80%A1%20%E2%80%A2%20%E2%80%B0%20%E2%80%B1%20%E2%80%BB%20%E2%80%BD%20%E2%81%82%20%E2%81%85%20%E2%81%86%20%E2%81%8A%20%E2%81%8B%20%E2%81%8C%20%E2%81%8D%20%E2%81%8E%20%E2%81%91%5d%5d%26%5b%5b%0d%0a%5b%2f%20%5c%2d%20%2b%20%21%20%2a%20%25%20%3c%2d%3e%20%5c%26%20%7c%20%5c%5e%20%7e%20%3f%5d%0d%0aU%2b00A1%2dU%2b00A7%0d%0aU%2b00A9%20U%2b00AB%0d%0aU%2b00AC%20U%2b00AE%0d%0aU%2b00B0%2dU%2b00B1%20U%2b00B6%20U%2b00BB%20U%2b00BF%20U%2b00D7%20U%2b00F7%0d%0aU%2b2016%2dU%2b2017%20U%2b2020%2dU%2b2027%0d%0aU%2b2030%2dU%2b203E%0d%0aU%2b2041%2dU%2b2053%0d%0aU%2b2055%2dU%2b205E%0d%0aU%2b2190%2dU%2b23FF%0d%0aU%2b2500%2dU%2b2775%0d%0aU%2b2794%2dU%2b2BFF%0d%0aU%2b2E00%2dU%2b2E7F%0d%0aU%2b3001%2dU%2b3003%0d%0aU%2b3008%2dU%2b3030%0d%0a%5d%0d%0a%5b%0d%0aU%2b0300%2dU%2b036F%0d%0aU%2b1DC0%2dU%2b1DFF%0d%0aU%2b20D0%2dU%2b20FF%0d%0aU%2bFE00%2dU%2bFE0F%0d%0aU%2bFE20%2dU%2bFE2F%0d%0aU%2bE0100%2dU%2bE01EF%0d%0a%5d%5d%5D" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none">986 code points</a></td><td style="box-sizing:border-box;padding:6px 13px;border:1px solid rgb(221,221,221)"><code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">\</code></td></tr><tr style="box-sizing:border-box;background-color:rgb(248,248,248);border-top-width:1px;border-top-style:solid;border-top-color:rgb(204,204,204)"><td style="box-sizing:border-box;padding:6px 13px;border:1px solid rgb(221,221,221)"><span style="box-sizing:border-box;font-weight:600">Shall not be an operator</span></td><td style="box-sizing:border-box;padding:6px 13px;border:1px solid rgb(221,221,221)"><a href="http://unicode.org/cldr/utility/list-unicodeset.jsp?a=%5B%5b%5b%0d%0a%5b%2f%20%5c%2d%20%2b%20%21%20%2a%20%25%20%3c%2d%3e%20%5c%26%20%7c%20%5c%5e%20%7e%20%3f%5d%0d%0aU%2b00A1%2dU%2b00A7%0d%0aU%2b00A9%20U%2b00AB%0d%0aU%2b00AC%20U%2b00AE%0d%0aU%2b00B0%2dU%2b00B1%20U%2b00B6%20U%2b00BB%20U%2b00BF%20U%2b00D7%20U%2b00F7%0d%0aU%2b2016%2dU%2b2017%20U%2b2020%2dU%2b2027%0d%0aU%2b2030%2dU%2b203E%0d%0aU%2b2041%2dU%2b2053%0d%0aU%2b2055%2dU%2b205E%0d%0aU%2b2190%2dU%2b23FF%0d%0aU%2b2500%2dU%2b2775%0d%0aU%2b2794%2dU%2b2BFF%0d%0aU%2b2E00%2dU%2b2E7F%0d%0aU%2b3001%2dU%2b3003%0d%0aU%2b3008%2dU%2b3030%0d%0a%5d%0d%0a%5b%0d%0aU%2b0300%2dU%2b036F%0d%0aU%2b1DC0%2dU%2b1DFF%0d%0aU%2b20D0%2dU%2b20FF%0d%0aU%2bFE00%2dU%2bFE0F%0d%0aU%2bFE20%2dU%2bFE2F%0d%0aU%2bE0100%2dU%2bE01EF%0d%0a%5d%5d-%5b%5b%3aPattern%5fSyntax%3a%5d%20%26%20%5b%3aMath%3a%5d%0d%0a%2d%20%5b%3aBlock%3dGeometric%20Shapes%3a%5d%0d%0a%2d%20%5b%3aBlock%3dMiscellaneous%20Symbols%3a%5d%0d%0a%2d%20%5b%3aBlock%3dMiscellaneous%20Technical%3a%5d%0d%0a%5b%21%20%25%20%5c%26%20%2a%20%5c%2d%20%2f%20%3f%20%5c%5c%20%5c%5e%20%C2%A1%20%C2%A6%20%C2%A7%20%C2%B0%20%C2%B6%20%C2%BF%20%E2%80%A0%20%E2%80%A1%20%E2%80%A2%20%E2%80%B0%20%E2%80%B1%20%E2%80%BB%20%E2%80%BD%20%E2%81%82%20%E2%81%85%20%E2%81%86%20%E2%81%8A%20%E2%81%8B%20%E2%81%8C%20%E2%81%8D%20%E2%81%8E%20%E2%81%91%5d%5d%5D" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none">130 unassigned code points;<br style="box-sizing:border-box">2,024 other code points</a></td><td style="box-sizing:border-box;padding:6px 13px;border:1px solid rgb(221,221,221)"><em style="box-sizing:border-box">All other code points</em></td></tr></tbody></table><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px"><span style="box-sizing:border-box;font-weight:600">Dots.</span> Adopt a rule to allow dots to appear in operators at any location, but only in runs of two or more. (Currently, dots must be leading.)</p><h2 style="box-sizing:border-box;margin-top:24px;margin-bottom:16px;line-height:1.25;padding-bottom:0.3em;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(238,238,238);color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol'"><a id="gmail-user-content-detailed-design" class="gmail-anchor" href="https://gist.github.com/xwu/d2c2bb7097b0b5a4e9985aae737a2651#detailed-design" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none;float:left;padding-right:4px;line-height:1"></a>Detailed design</h2><h3 style="box-sizing:border-box;margin-top:24px;margin-bottom:16px;font-size:1.25em;line-height:1.25;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol'"><a id="gmail-user-content-identifiers" class="gmail-anchor" href="https://gist.github.com/xwu/d2c2bb7097b0b5a4e9985aae737a2651#identifiers" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none;float:left;padding-right:4px;line-height:1"></a>Identifiers</h3><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px">Swift identifier characters shall <a href="http://unicode.org/reports/tr31/#Conformance" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none">conform to UAX#31</a> as follows:</p><ul style="box-sizing:border-box;padding-left:2em;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px"><li style="box-sizing:border-box"><p style="box-sizing:border-box;margin-top:16px;margin-bottom:16px"><a href="http://unicode.org/reports/tr31/#C1" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none"><span style="box-sizing:border-box;font-weight:600">UAX31-C1.</span></a> The conformance described herein refers to the Unicode 9.0.0 version of UAX#31.</p></li><li style="box-sizing:border-box;margin-top:0.25em"><p style="box-sizing:border-box;margin-top:16px;margin-bottom:16px"><a href="http://unicode.org/reports/tr31/#C2" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none"><span style="box-sizing:border-box;font-weight:600">UAX31-C2.</span></a> Swift shall observe the following requirements:</p><ul style="box-sizing:border-box;padding-left:2em;margin-top:0px;margin-bottom:0px"><li style="box-sizing:border-box"><p style="box-sizing:border-box;margin-top:16px;margin-bottom:16px"><a href="http://unicode.org/reports/tr31/#R1" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none"><span style="box-sizing:border-box;font-weight:600">UAX31-R1.</span></a> Swift shall augment the definition of "Default Identifiers" with the following <span style="box-sizing:border-box;font-weight:600">profiles</span>:</p><ol style="box-sizing:border-box;padding-left:2em;margin-top:0px;margin-bottom:0px;list-style-type:lower-alpha"><li style="box-sizing:border-box"><p style="box-sizing:border-box;margin-top:16px;margin-bottom:16px"><code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">ID_Start</code> and <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">ID_Continue</code> shall be used for <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">Start</code> and <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">Continue</code>, replacing <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">XID_Start</code> and <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">XID_Continue</code>. This <span style="box-sizing:border-box;font-weight:600">excludes</span> characters in <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">Other_ID_Start</code> and <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">Other_ID_Continue</code>.</p></li><li style="box-sizing:border-box;margin-top:0.25em"><p style="box-sizing:border-box;margin-top:16px;margin-bottom:16px">_ 005F LOW LINE shall additionally be allowed as a <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">Start</code> character.</p></li><li style="box-sizing:border-box;margin-top:0.25em"><p style="box-sizing:border-box;margin-top:16px;margin-bottom:16px">Certain emoji shall additionally be allowed as <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">Start</code> characters. A detailed design for emoji permitted in identifiers is given below.</p></li><li style="box-sizing:border-box;margin-top:0.25em"><p style="box-sizing:border-box;margin-top:16px;margin-bottom:16px"><a href="http://unicode.org/reports/tr31/#R1a" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none"><span style="box-sizing:border-box;font-weight:600">UAX31-R1a.</span></a> The join-control characters ZWJ and ZWNJ are strictly limited to the special cases A1, A2, and B described in UAX#31.</p></li></ol></li><li style="box-sizing:border-box;margin-top:0.25em"><p style="box-sizing:border-box;margin-top:16px;margin-bottom:16px"><a href="http://unicode.org/reports/tr31/#R4" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none"><span style="box-sizing:border-box;font-weight:600">UAX31-R4.</span></a> Swift shall consider two identifiers equivalent when they produce the same normalized form under <a href="http://unicode.org/reports/tr15/" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none">Normalization Form C (NFC)</a>, as recommended in UAX#31 for <span style="box-sizing:border-box;font-weight:600">case-sensitive</span> use cases.</p></li></ul></li></ul><h4 style="box-sizing:border-box;margin-top:24px;margin-bottom:16px;font-size:16px;line-height:1.25;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol'"><a id="gmail-user-content-grammar-changes" class="gmail-anchor" href="https://gist.github.com/xwu/d2c2bb7097b0b5a4e9985aae737a2651#grammar-changes" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none;float:left;padding-right:4px;line-height:1"></a>Grammar changes</h4><pre style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;margin-top:0px;margin-bottom:16px;line-height:1.45;word-wrap:normal;padding:16px;overflow:auto;background-color:rgb(247,247,247);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;color:rgb(51,51,51)"><code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;padding:0px;margin:0px;background-color:transparent;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;word-break:normal;border:0px;display:inline;overflow:visible;line-height:inherit;word-wrap:normal">identifier-head → [:ID_Start:]
identifier-head → _
identifier-head → identifier-emoji
identifier-character → identifier-head
identifier-character → [:ID_Continue:]
</code></pre><h3 style="box-sizing:border-box;margin-top:24px;margin-bottom:16px;font-size:1.25em;line-height:1.25;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol'"><a id="gmail-user-content-operators" class="gmail-anchor" href="https://gist.github.com/xwu/d2c2bb7097b0b5a4e9985aae737a2651#operators" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none;float:left;padding-right:4px;line-height:1"></a>Operators</h3><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px">Swift operator characters shall be determined as follows:</p><ul style="box-sizing:border-box;padding-left:2em;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px"><li style="box-sizing:border-box"><p style="box-sizing:border-box;margin-top:16px;margin-bottom:16px">Valid operator characters shall consist of <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">Pattern_Syntax</code> code points with a derived property <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">Math</code>. However, the following blocks are excluded: Geometric Shapes, Miscellaneous Symbols, and Miscellaneous Technical. In UnicodeSet notation:</p><pre style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;margin-top:0px;margin-bottom:16px;line-height:1.45;word-wrap:normal;padding:16px;overflow:auto;background-color:rgb(247,247,247);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px"><code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;padding:0px;margin:0px;background-color:transparent;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;word-break:normal;border:0px;display:inline;overflow:visible;line-height:inherit;word-wrap:normal">[:Pattern_Syntax:] & [:Math:]
- [:Block=Geometric Shapes:]
- [:Block=Miscellaneous Symbols:]
- [:Block=Miscellaneous Technical:]
</code></pre><p style="box-sizing:border-box;margin-top:16px;margin-bottom:16px"><code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">Math</code> captures a fuller set of operators than is possible using <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">Sm</code>, and we avoid the inclusion of characters in <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">So</code> that are clearly not "operator-like" (such as Braille). <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">Math</code> code points in the excluded blocks include sign parts such as ⎲ SUMMATION TOP and tenuously "operator-like" code points such as <span style="box-sizing:border-box;font-family:'apple color emoji','segoe ui','segoe ui emoji','segoe ui symbol';font-size:18px;line-height:20px;vertical-align:middle">♠️</span> BLACK SPADE SUIT.</p></li><li style="box-sizing:border-box;margin-top:0.25em"><p style="box-sizing:border-box;margin-top:16px;margin-bottom:16px">The set of valid operator characters shall be augmented with the following ASCII characters: <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">!</code>, <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">%</code>, <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">&</code>, <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">*</code>, <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">-</code>, <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">/</code>, <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">?</code>, <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">\</code>, <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">^</code>. These ASCII characters are required by the Swift standard library and/or considered "weakly mathematical" in <a href="http://www.unicode.org/reports/tr25/" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none">UAX#25</a>.</p></li><li style="box-sizing:border-box;margin-top:0.25em"><p style="box-sizing:border-box;margin-top:16px;margin-bottom:16px">For increased compatibility with Swift 3, the set of valid operator characters shall be augmented with the following Latin-1 Supplement characters: <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">¡</code>, <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">¦</code>, <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">§</code>, <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">°</code>, <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">¶</code>, <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">¿</code>. For the same reason, augment the set of valid operator characters with the following General Punctuation characters: † DAGGER, ‡ DOUBLE DAGGER, • BULLET, ‰ PER MILLE SIGN, ‱ PER TEN THOUSAND SIGN, ※ REFERENCE MARK, ‽ INTERROBANG, ⁂ ASTERISM, ⁅ LEFT SQUARE BRACKET WITH QUILL, ⁆ RIGHT SQUARE BRACKET WITH QUILL, ⁊ TIRONIAN SIGN ET, ⁋ REVERSED PILCROW SIGN, ⁌ BLACK LEFTWARDS BULLET, ⁍ BLACK RIGHTWARDS BULLET, ⁎ LOW ASTERISK, ⁑ TWO ASTERISKS ALIGNED VERTICALLY.</p></li><li style="box-sizing:border-box;margin-top:0.25em"><p style="box-sizing:border-box;margin-top:16px;margin-bottom:16px">Swift shall consider two operators equivalent when they produce the same normalized form under <a href="http://unicode.org/reports/tr15/" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none">Normalization Form KC (NFKC)</a>, as recommended in UAX#31 for <em style="box-sizing:border-box">case-insensitive</em> use cases. Crucially, fullwidth variants such as FULLWIDTH HYPHEN-MINUS are equivalent to their non-fullwidth counterparts after normalization under NFKC (but not NFC).</p></li><li style="box-sizing:border-box;margin-top:0.25em"><p style="box-sizing:border-box;margin-top:16px;margin-bottom:16px">Certainly strongly mathematical arrows now have an <em style="box-sizing:border-box">alternative</em> emoji presentation, and future versions of Unicode may add such an emoji presentation to any Swift operator character. Some but not all "environments" or applications (for instance, Safari but not TextWrangler) display the alternative emoji presentation at all times, and such discrepancies between applications are explicitly permitted by Unicode recommendations (see dicussion in <em style="box-sizing:border-box">Emoji</em>). However, it would be highly unusual to define the set of valid operator characters based on an essentially arbitrary criterion as to whether an alternative emoji presentation is retroactively assigned to a code point, and codifying how IDEs display Unicode characters in Swift files is outside the scope of this proposal. Therefore, valid operator characters are defined without regard to the presence or absence of an alternative emoji presentation, and U+FE0E VARIATION SELECTOR-15 (text presentation selector) is <em style="box-sizing:border-box">optionally</em> permitted to follow an operator character that has an alternative emoji presentation. Note that variation selectors are discarded by normalization.</p></li></ul><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px"><a href="http://unicode.org/cldr/utility/list-unicodeset.jsp?a=%5B%3APattern_Syntax%3A%5D+%26+%5B%3AMath%3A%5D%0D%0A-+%5B%3ABlock%3DGeometric+Shapes%3A%5D%0D%0A-+%5B%3ABlock%3DMiscellaneous+Symbols%3A%5D%0D%0A-+%5B%3ABlock%3DMiscellaneous+Technical%3A%5D%0D%0A%5B%21+%25+%5C%26+*+%5C-+%2F+%3F+%5C%5C+%5C%5E+%C2%A1+%C2%A6+%C2%A7+%C2%B0+%C2%B6+%C2%BF+%E2%80%A0+%E2%80%A1+%E2%80%A2+%E2%80%B0+%E2%80%B1+%E2%80%BB+%E2%80%BD+%E2%81%82+%E2%81%85+%E2%81%86+%E2%81%8A+%E2%81%8B+%E2%81%8C+%E2%81%8D+%E2%81%8E+%E2%81%91%5D&g=&i=" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none">These revised rules</a> produce a set of 987 code points for operator characters. Since <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">ID_Start</code> is derived in part by exclusion of <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">Pattern_Syntax</code> code points, it is assured that operator and identifier characters do not overlap (although this assurance does not extend to emoji, which require additional design as detailed below).</p><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px">All current restrictions on reserved tokens and operators remain. Swift reserves <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">=</code>, <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">-></code>, <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">//</code>, <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">/*</code>, <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">*/</code>, <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">.</code>, <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">?</code>, prefix <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px"><</code>, prefix <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">&</code>, postfix <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">></code>, and postfix <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">!</code>.</p><h4 style="box-sizing:border-box;margin-top:24px;margin-bottom:16px;font-size:16px;line-height:1.25;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol'"><a id="gmail-user-content-dots" class="gmail-anchor" href="https://gist.github.com/xwu/d2c2bb7097b0b5a4e9985aae737a2651#dots" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none;float:left;padding-right:4px;line-height:1"></a>Dots</h4><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px">Swift's existing rule for dots in operators is:</p><blockquote style="box-sizing:border-box;margin:0px 0px 16px;padding:0px 1em;color:rgb(119,119,119);border-left-width:0.25em;border-left-style:solid;border-left-color:rgb(221,221,221);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px"><p style="box-sizing:border-box;margin-top:0px;margin-bottom:0px">If an operator doesn’t begin with a dot, it can’t contain a dot elsewhere.</p></blockquote><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px">This proposal modifies the rule to:</p><blockquote style="box-sizing:border-box;margin:0px 0px 16px;padding:0px 1em;color:rgb(119,119,119);border-left-width:0.25em;border-left-style:solid;border-left-color:rgb(221,221,221);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px"><p style="box-sizing:border-box;margin-top:0px;margin-bottom:0px">Dots may only appear in operators in sequences of two or more.</p></blockquote><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px">Incorporating the "two-dot rule" offers the following benefits:</p><ul style="box-sizing:border-box;padding-left:2em;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px"><li style="box-sizing:border-box"><p style="box-sizing:border-box;margin-top:16px;margin-bottom:16px">It avoids lexical complications arising from lone <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">.</code>.</p></li><li style="box-sizing:border-box;margin-top:0.25em"><p style="box-sizing:border-box;margin-top:16px;margin-bottom:16px">The approach is conservative, erring on the side of overly restrictive. Dropping the rule in future (and thereby allowing single dots) may be possible.</p></li><li style="box-sizing:border-box;margin-top:0.25em"><p style="box-sizing:border-box;margin-top:16px;margin-bottom:16px">It does not require special cases for existing infix dot operators in the standard library, <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">...</code> (closed range) and <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">..<</code>(half-open range). It leaves open the possibility of adding analogous half-open and fully-open range operators <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px"><..</code>and <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px"><..<</code>. </p></li></ul><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px">Finally, this proposal <em style="box-sizing:border-box">reserves</em> the <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">..</code> operator for a possible "method cascade" syntax in the future <a href="http://news.dartlang.org/2012/02/method-cascades-in-dart-posted-by-gilad.html" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none">as supported by Dart</a>.</p><h4 style="box-sizing:border-box;margin-top:24px;margin-bottom:16px;font-size:16px;line-height:1.25;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol'"><a id="gmail-user-content-grammar-changes-1" class="gmail-anchor" href="https://gist.github.com/xwu/d2c2bb7097b0b5a4e9985aae737a2651#grammar-changes-1" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none;float:left;padding-right:4px;line-height:1"></a>Grammar changes</h4><pre style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;margin-top:0px;margin-bottom:16px;line-height:1.45;word-wrap:normal;padding:16px;overflow:auto;background-color:rgb(247,247,247);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;color:rgb(51,51,51)"><code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;padding:0px;margin:0px;background-color:transparent;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;word-break:normal;border:0px;display:inline;overflow:visible;line-height:inherit;word-wrap:normal">operator → operator-head operator-characters[opt]
operator-head → [[:Pattern_Syntax:] & [:Math:] - [:Emoji:] - [:Block=Geometric Shapes:] - [:Block=Miscellaneous Symbols:] - [:Block=Miscellaneous Technical:]]
operator-head → [[:Pattern_Syntax:] & [:Math:] & [:Emoji:] - [:Block=Geometric Shapes:] - [:Block=Miscellaneous Symbols:] - [:Block=Miscellaneous Technical:]] U+FE0E[opt]
operator-head → ! | % | & | * | - | / | ? | \ | ^ | ¡ | ¦ | § | ° | ¶ | ¿
operator-head → † | ‡ | • | ‰ | ‱ | ※ | ‽ | ⁂ | ⁅ | ⁆ | ⁊ | ⁋ | ⁌ | ⁍ | ⁎ | ⁑
operator-head → operator-dot operator-dots
operator-character → operator-head
operator-characters → operator-character operator-character[opt]
operator-dot → .
operator-dots → operator-dot operator-dots[opt]
</code></pre><h3 style="box-sizing:border-box;margin-top:24px;margin-bottom:16px;font-size:1.25em;line-height:1.25;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol'"><a id="gmail-user-content-emoji" class="gmail-anchor" href="https://gist.github.com/xwu/d2c2bb7097b0b5a4e9985aae737a2651#emoji" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none;float:left;padding-right:4px;line-height:1"></a>Emoji</h3><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px">The inclusion of emoji among valid identifier characters, though highly desired, presents significant challenges:</p><ul style="box-sizing:border-box;padding-left:2em;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px"><li style="box-sizing:border-box"><p style="box-sizing:border-box;margin-top:16px;margin-bottom:16px">Emoji characters are not displayed uniformly across different platforms.</p></li><li style="box-sizing:border-box;margin-top:0.25em"><p style="box-sizing:border-box;margin-top:16px;margin-bottom:16px">Whether any particular character is presented as emoji or text depends on a matrix of considerations, including "environment" (e.g., Safari vs. XCode), presence or absence of a variant selector, and whether the character itself defaults to "emoji presentation" or "text presentation." This behavior is specifically documented in <a href="http://unicode.org/reports/tr51/#Presentation_Style" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none">Unicode recommendations</a>.</p></li><li style="box-sizing:border-box;margin-top:0.25em"><p style="box-sizing:border-box;margin-top:16px;margin-bottom:16px">Some emoji not classified as <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">Math</code> depict operators: <span style="box-sizing:border-box;font-family:'apple color emoji','segoe ui','segoe ui emoji','segoe ui symbol';font-size:18px;line-height:20px;vertical-align:middle">❗️</span><span style="box-sizing:border-box;font-family:'apple color emoji','segoe ui','segoe ui emoji','segoe ui symbol';font-size:18px;line-height:20px;vertical-align:middle">❓</span><span style="box-sizing:border-box;font-family:'apple color emoji','segoe ui','segoe ui emoji','segoe ui symbol';font-size:18px;line-height:20px;vertical-align:middle">➕</span><span style="box-sizing:border-box;font-family:'apple color emoji','segoe ui','segoe ui emoji','segoe ui symbol';font-size:18px;line-height:20px;vertical-align:middle">➖</span><span style="box-sizing:border-box;font-family:'apple color emoji','segoe ui','segoe ui emoji','segoe ui symbol';font-size:18px;line-height:20px;vertical-align:middle">➗</span><span style="box-sizing:border-box;font-family:'apple color emoji','segoe ui','segoe ui emoji','segoe ui symbol';font-size:18px;line-height:20px;vertical-align:middle">✖️</span>. <a href="http://unicode.org/emoji/charts/emoji-ordering.html" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none">A Unicode chart</a> provides additional information by dividing emoji according to "rough categories," but it warns that these categories "may change at any time, and should not be used in production."</p></li><li style="box-sizing:border-box;margin-top:0.25em"><p style="box-sizing:border-box;margin-top:16px;margin-bottom:16px">Full emoji support would require allowing identifiers to contain zero-width joiner sequences that UAX#31 would forbid. Some normalization scheme would have to be devised to account for Unicode recommendations that <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">👩❤️👨</code> (U+1F469 U+200D U+2764 U+FE0F U+200D U+1F468) can be displayed as either <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">💑</code> (U+1F491) or, as a fallback, <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">👩❤️👨</code>(U+1F469 U+2764 U+FE0F U+1F468).</p></li></ul><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px">For maximum consistency across platforms, valid emoji in Swift identifiers shall be determined using the following rules:</p><ul style="box-sizing:border-box;padding-left:2em;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px"><li style="box-sizing:border-box"><p style="box-sizing:border-box;margin-top:16px;margin-bottom:16px">Emoji shall include code points with default emoji presentation (as opposed to text presentation), minus <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">Emoji_Defectives</code> and <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">ID_Continue</code>. Exclude <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">Pattern_Syntax</code> code points unless they are in the following blocks: Miscellaneous Symbols, Miscellaneous Technical.</p></li><li style="box-sizing:border-box;margin-top:0.25em"><p style="box-sizing:border-box;margin-top:16px;margin-bottom:16px">Emoji shall include <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">Emoji</code> code points with default text presentation <em style="box-sizing:border-box">when immediately followed by U+FE0F VARIATION SELECTOR-16 (emoji presentation selector)</em>, minus <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">Emoji_Defectives</code> and <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">ID_Continue</code>. Again, exclude <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">Pattern_Syntax</code> code points unless they are in the following blocks: Miscellaneous Symbols, Miscellaneous Technical. (Note that the emoji picker on Apple platforms--and, possibly, other platforms--automatically inserts U+FE0F VARIATION SELECTOR-16 when a user selects such code points; for instance, selecting <span style="box-sizing:border-box;font-family:'apple color emoji','segoe ui','segoe ui emoji','segoe ui symbol';font-size:18px;line-height:20px;vertical-align:middle">❤️</span> inserts U+2764 U+FE0F. Therefore, it is important that the invisible U+FE0F be permitted strictly in this use case. Note also that variation selectors are discarded by normalization.)</p></li><li style="box-sizing:border-box;margin-top:0.25em"><p style="box-sizing:border-box;margin-top:16px;margin-bottom:16px">Emoji shall include <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">Emoji_Flag_Sequences</code>, <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">Emoji_Keycap_Sequences</code>, and (to the extent not already included) <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">Emoji_Modifier_Sequences</code>.</p></li></ul><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px"><a href="http://unicode.org/cldr/utility/list-unicodeset.jsp?a=%5B%5B%3AEmoji_Presentation%3A%5D+-+%5B%3AEmoji_Defectives%3A%5D+-+%5B%3AID_Continue%3A%5D+-+%5B%3APattern_Syntax%3A%5D%5D%0D%0A%5B%5B%3AEmoji_Presentation%3A%5D+-+%5B%3AEmoji_Defectives%3A%5D+-+%5B%3AID_Continue%3A%5D+%26+%5B%3APattern_Syntax%3A%5D+%26+%5B%3ABlock%3DMiscellaneous+Symbols%3A%5D%5D%0D%0A%5B%5B%3AEmoji_Presentation%3A%5D+-+%5B%3AEmoji_Defectives%3A%5D+-+%5B%3AID_Continue%3A%5D+%26+%5B%3APattern_Syntax%3A%5D+%26+%5B%3ABlock%3DMiscellaneous+Technical%3A%5D%5D%0D%0A%5B%5B%3AEmoji%3A%5D+-+%5B%3AEmoji_Defectives%3A%5D+-+%5B%3AEmoji_Presentation%3A%5D+-+%5B%3AID_Continue%3A%5D+-+%5B%3APattern_Syntax%3A%5D%5D%0D%0A%5B%5B%3AEmoji%3A%5D+-+%5B%3AEmoji_Defectives%3A%5D+-+%5B%3AEmoji_Presentation%3A%5D+-+%5B%3AID_Continue%3A%5D+%26+%5B%3APattern_Syntax%3A%5D+%26+%5B%3ABlock%3DMiscellaneous+Symbols%3A%5D%5D%0D%0A%5B%5B%3AEmoji%3A%5D+-+%5B%3AEmoji_Defectives%3A%5D+-+%5B%3AEmoji_Presentation%3A%5D+-+%5B%3AID_Continue%3A%5D+%26+%5B%3APattern_Syntax%3A%5D+%26+%5B%3ABlock%3DMiscellaneous+Technical%3A%5D%5D%0D%0A%5B%3AEmoji_Flag_Sequences%3A%5D%0D%0A%5B%3AEmoji_Keycap_Sequences%3A%5D%0D%0A%5B%3AEmoji_Modifier_Sequences%3A%5D&g=&i=" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none">These revised rules</a> produce a set of 1,625 code points or sequences, of which 98 are currently categorized as operator characters.</p><h4 style="box-sizing:border-box;margin-top:24px;margin-bottom:16px;font-size:16px;line-height:1.25;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol'"><a id="gmail-user-content-grammar-changes-2" class="gmail-anchor" href="https://gist.github.com/xwu/d2c2bb7097b0b5a4e9985aae737a2651#grammar-changes-2" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none;float:left;padding-right:4px;line-height:1"></a>Grammar changes</h4><pre style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;margin-top:0px;margin-bottom:16px;line-height:1.45;word-wrap:normal;padding:16px;overflow:auto;background-color:rgb(247,247,247);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;color:rgb(51,51,51)"><code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;padding:0px;margin:0px;background-color:transparent;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;word-break:normal;border:0px;display:inline;overflow:visible;line-height:inherit;word-wrap:normal">identifier-emoji → [[:Emoji_Presentation:] - [:Emoji_Defectives:] - [:ID_Continue:] - [:Pattern_Syntax:]]
identifier-emoji → [[:Emoji_Presentation:] - [:Emoji_Defectives:] - [:ID_Continue:] & [:Pattern_Syntax:] & [:Block=Miscellaneous Symbols:]]
identifier-emoji → [[:Emoji_Presentation:] - [:Emoji_Defectives:] - [:ID_Continue:] & [:Pattern_Syntax:] & [:Block=Miscellaneous Technical:]]
identifier-emoji → [[:Emoji:] - [:Emoji_Defectives:] - [:Emoji_Presentation:] - [:ID_Continue:] - [:Pattern_Syntax:]] U+FE0F
identifier-emoji → [[:Emoji:] - [:Emoji_Defectives:] - [:Emoji_Presentation:] - [:ID_Continue:] & [:Pattern_Syntax:] & [:Block=Miscellaneous Symbols:]] U+FE0F
identifier-emoji → [[:Emoji:] - [:Emoji_Defectives:] - [:Emoji_Presentation:] - [:ID_Continue:] & [:Pattern_Syntax:] & [:Block=Miscellaneous Technical:]] U+FE0F
identifier-emoji → [[:Emoji_Flag_Sequences:] [:Emoji_Keycap_Sequences:] [:Emoji_Modifier_Sequences:]]
</code></pre><h2 style="box-sizing:border-box;margin-top:24px;margin-bottom:16px;line-height:1.25;padding-bottom:0.3em;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(238,238,238);color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol'"><a id="gmail-user-content-source-compatibility" class="gmail-anchor" href="https://gist.github.com/xwu/d2c2bb7097b0b5a4e9985aae737a2651#source-compatibility" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none;float:left;padding-right:4px;line-height:1"></a>Source compatibility</h2><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px">This change is source-breaking where developers have incorporated certain emoji in identifiers or certain non-ASCII characters in operators. This is unlikely to be a significant breakage for the majority of Swift code. Diagnostics for invalid characters are already produced today. We can improve them easily if needed.</p><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px">Maintaining source compatibility for Swift 3 should be easy: keep the old parsing and identifier lookup code.</p><h2 style="box-sizing:border-box;margin-top:24px;margin-bottom:16px;line-height:1.25;padding-bottom:0.3em;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(238,238,238);color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol'"><a id="gmail-user-content-effect-on-abi-stability" class="gmail-anchor" href="https://gist.github.com/xwu/d2c2bb7097b0b5a4e9985aae737a2651#effect-on-abi-stability" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none;float:left;padding-right:4px;line-height:1"></a>Effect on ABI stability</h2><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px">This proposal does not affect the ABI format itself. Normalization of Unicode identifiers would affect the ABI of compiled modules. The standard library will not be affected; it uses ASCII symbols with no combining characters.</p><h2 style="box-sizing:border-box;margin-top:24px;margin-bottom:16px;line-height:1.25;padding-bottom:0.3em;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(238,238,238);color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol'"><a id="gmail-user-content-effect-on-api-resilience" class="gmail-anchor" href="https://gist.github.com/xwu/d2c2bb7097b0b5a4e9985aae737a2651#effect-on-api-resilience" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none;float:left;padding-right:4px;line-height:1"></a>Effect on API resilience</h2><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px">This proposal doesn't affect API resilience.</p><h2 style="box-sizing:border-box;margin-top:24px;margin-bottom:16px;line-height:1.25;padding-bottom:0.3em;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(238,238,238);color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol'"><a id="gmail-user-content-alternatives-considered" class="gmail-anchor" href="https://gist.github.com/xwu/d2c2bb7097b0b5a4e9985aae737a2651#alternatives-considered" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none;float:left;padding-right:4px;line-height:1"></a>Alternatives considered</h2><ul style="box-sizing:border-box;padding-left:2em;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px"><li style="box-sizing:border-box"><p style="box-sizing:border-box;margin-top:16px;margin-bottom:16px">Use NFKC instead of NFC for identifiers. The decision to use NFC is based on UAX#31, which states:</p><blockquote style="box-sizing:border-box;margin:0px 0px 16px;padding:0px 1em;color:rgb(119,119,119);border-left-width:0.25em;border-left-style:solid;border-left-color:rgb(221,221,221)"><p style="box-sizing:border-box;margin-top:0px;margin-bottom:0px">Generally if the programming language has case-sensitive identifiers, then Normalization Form C is appropriate; whereas, if the programming language has case-insensitive identifiers, then Normalization Form KC is more appropriate.</p></blockquote></li><li style="box-sizing:border-box;margin-top:0.25em"><p style="box-sizing:border-box;margin-top:16px;margin-bottom:16px">Eliminate emoji from identifiers and restrict operator characters to a limited number of ASCII code points. This approach would be simpler, but feedback on Swift-Evolution has been overwhelmingly against such a change.</p></li><li style="box-sizing:border-box;margin-top:0.25em"><p style="box-sizing:border-box;margin-top:16px;margin-bottom:16px">Hand-pick a set of "operator-like" characters to include. The proposal authors tried this painstaking approach and came up with a relatively agreeable set of about <a href="http://unicode.org/cldr/utility/list-unicodeset.jsp?a=%5B%21%5C%24%25%5C%26*%2B%5C-%2F%3C%3D%3E%3F%5C%5E%7C%7E%0D%0A%0D%0A%5Cu00AC%0D%0A%5Cu00B1%0D%0A%5Cu00B7%0D%0A%5Cu00D7%0D%0A%5Cu00F7%0D%0A%0D%0A%5Cu2208-%5Cu220D%0D%0A%5Cu220F-%5Cu2211%0D%0A%5Cu22C0-%5Cu22C3%0D%0A%5Cu2212-%5Cu221D%0D%0A%5Cu2238%0D%0A%5Cu223A%0D%0A%5Cu2240%0D%0A%5Cu228C-%5Cu228E%0D%0A%5Cu2293-%5Cu22A3%0D%0A%5Cu22BA-%5Cu22BD%0D%0A%5Cu22C4-%5Cu22C7%0D%0A%5Cu22C9-%5Cu22CC%0D%0A%5Cu22D2-%5Cu22D3%0D%0A%5Cu2223-%5Cu222A%0D%0A%5Cu2236-%5Cu2237%0D%0A%5Cu2239%0D%0A%5Cu223B-%5Cu223E%0D%0A%5Cu2241-%5Cu228B%0D%0A%5Cu228F-%5Cu2292%0D%0A%5Cu22A6-%5Cu22B9%0D%0A%5Cu22C8%0D%0A%5Cu22CD%0D%0A%5Cu22D0-%5Cu22D1%0D%0A%5Cu22D4-%5Cu22FF%0D%0A%5Cu22CE-%5Cu22CF%0D%0A%0D%0A%5Cu2A00-%5Cu2AFF%0D%0A%0D%0A%5Cu27C2%0D%0A%5Cu27C3%0D%0A%5Cu27C4%0D%0A%5Cu27C7%0D%0A%5Cu27C8%0D%0A%5Cu27C9%0D%0A%5Cu27CA%0D%0A%5Cu27CE-%5Cu27D7%0D%0A%5Cu27DA-%5Cu27DF%0D%0A%5Cu27E0-%5Cu27E5%0D%0A%0D%0A%5Cu29B5-%5Cu29C3%0D%0A%5Cu29C4-%5Cu29C9%0D%0A%5Cu29CA-%5Cu29D0%0D%0A%5Cu29D1-%5Cu29D7%0D%0A%5Cu29DF%0D%0A%5Cu29E1%0D%0A%5Cu29E2%0D%0A%5Cu29E3-%5Cu29E6%0D%0A%5Cu29FA%0D%0A%5Cu29FB%0D%0A%0D%0A%5Cu2308-%5Cu230B%0D%0A%5Cu2336-%5Cu237A%0D%0A%5Cu2395%5D" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none">650 code points</a>. Such a list can carefully avoid idiosyncrasies in the Unicode standard. However, a character-by-character inventory is unlikely to converge on consensus, as likely to introduce unintended Swift-specific idiosyncrasies as it is to avoid Unicode shortcomings, and inconsistent with the Unicode method of deriving such lists using categories.</p></li><li style="box-sizing:border-box;margin-top:0.25em"><p style="box-sizing:border-box;margin-top:16px;margin-bottom:16px">Continue to allow single <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">.</code> in operators, perhaps even expanding the original rule to allow them anywhere (even if the operator does not begin with <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">.</code>).</p><p style="box-sizing:border-box;margin-top:16px;margin-bottom:16px">This would allow a wider variety of custom operators (for some interesting possibilities, see the operators in Haskell's <a href="https://github.com/ekmett/lens/wiki/Operators" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none">Lens</a> package). However, there are a handful of potential complications:</p><ul style="box-sizing:border-box;padding-left:2em;margin-top:0px;margin-bottom:0px"><li style="box-sizing:border-box"><p style="box-sizing:border-box;margin-top:16px;margin-bottom:16px">Combining prefix or postfix operators with member access: <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">foo*.bar</code> would need to be parsed as <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">foo *. bar</code>rather than <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">(foo*).bar</code>. Parentheses could be required to disambiguate.</p></li><li style="box-sizing:border-box;margin-top:0.25em"><p style="box-sizing:border-box;margin-top:16px;margin-bottom:16px">Combining infix operators with contextual members: <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">foo*.bar</code> would need to be parsed as <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">foo *. bar</code> rather than <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">foo * (.bar)</code>. Whitespace or parentheses could be required to disambiguate.</p></li><li style="box-sizing:border-box;margin-top:0.25em"><p style="box-sizing:border-box;margin-top:16px;margin-bottom:16px">Hypothetically, if operators were accessible as members such as <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">MyNumber.+</code>, allowing operators with single <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">.</code>s would require escaping operator names (perhaps with backticks, such as <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">MyNumber.`+`</code>).</p></li></ul><p style="box-sizing:border-box;margin-top:16px;margin-bottom:16px">This would also require operators of the form <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">[!?]*\.</code> (for example <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">.</code> <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">?.</code> <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">!.</code> <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">!!.</code>) to be reserved, to prevent users from defining custom operators that conflict with member access and optional chaining.</p><p style="box-sizing:border-box;margin-top:16px;margin-bottom:16px">We believe that requiring dots to appear in groups of at least two, while in some ways more restrictive, will prevent a significant amount of future pain, and does not require special-case considerations such as the above.</p></li></ul><h2 style="box-sizing:border-box;margin-top:24px;margin-bottom:16px;line-height:1.25;padding-bottom:0.3em;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(238,238,238);color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol'"><a id="gmail-user-content-future-directions" class="gmail-anchor" href="https://gist.github.com/xwu/d2c2bb7097b0b5a4e9985aae737a2651#future-directions" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none;float:left;padding-right:4px;line-height:1"></a>Future directions</h2><p style="box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px">While not within the scope of this proposal, the following considerations may provide useful context for the proposed changes. We encourage the community to pick up these topics when the time is right.</p><ul style="box-sizing:border-box;padding-left:2em;margin-top:0px;color:rgb(51,51,51);font-family:-apple-system,blinkmacsystemfont,'segoe ui',helvetica,arial,sans-serif,'apple color emoji','segoe ui emoji','segoe ui symbol';font-size:16px;margin-bottom:0px"><li style="box-sizing:border-box"><p style="box-sizing:border-box;margin-top:16px;margin-bottom:16px"><span style="box-sizing:border-box;font-weight:600">Introduce a syntax for method cascades.</span> The Dart language supports <a href="http://news.dartlang.org/2012/02/method-cascades-in-dart-posted-by-gilad.html" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none">method cascades</a>, whereby multiple methods can be called on an object within one expression: <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">foo..bar()..baz()</code> effectively performs <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">foo.bar(); foo.baz()</code>. This syntax can also be used with assignments and subscripts. Such a feature might be very useful in Swift; this proposal reserves the <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">..</code> operator so that it may be added in the future.</p></li><li style="box-sizing:border-box;margin-top:0.25em"><p style="box-sizing:border-box;margin-top:16px;margin-bottom:16px"><span style="box-sizing:border-box;font-weight:600">Introduce "mixfix" operator declarations.</span> Mixfix operators are based on pattern matching and would allow more than two operands. For example, the ternary operator <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">? :</code> can be defined as a mixfix operator with three "holes": <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">_ ? _ : _</code>. Subscripts might be subsumed by mixfix declarations such as <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">_ [ _ ]</code>. Some holes could be made <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">@autoclosure</code>, and there might even be holes whose argument is represented as an AST, rather than a value or thunk, supporting advanced metaprogramming (for instance, F#'s <a href="https://docs.microsoft.com/en-us/dotnet/articles/fsharp/language-reference/code-quotations" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none">code quotations</a>). Should mixfix operators become supported, it would be sensible to add brackets to the set of valid operator characters.</p></li><li style="box-sizing:border-box;margin-top:0.25em"><p style="box-sizing:border-box;margin-top:16px;margin-bottom:16px"><span style="box-sizing:border-box;font-weight:600">Diminish or remove the lexical distinction between operators and identifiers.</span> If precedence and fixity applied to traditional identifiers as well as operators, it would be possible to incorporate ASCII equivalents for standard operators (e.g. <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">and</code> for <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">&&</code>, to allow <code style="box-sizing:border-box;font-family:sfmono-regular,consolas,'liberation mono',menlo,courier,monospace;font-size:13.600000381469727px;padding:0.2em 0px;margin:0px;background-color:rgba(0,0,0,0.0392157);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px">A and B</code>). If additionally combined with mixfix operator support, this might enable powerful DSLs (for instance, C#'s <a href="https://en.wikipedia.org/wiki/Language_Integrated_Query" style="box-sizing:border-box;background-color:transparent;color:rgb(64,120,192);text-decoration:none">LINQ</a>).</p></li></ul></div></div>