<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">+1.<div class=""><br class=""><div><blockquote type="cite" class=""><div class="">Le 10 mai 2017 à 16:51, Ben Cohen via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> a écrit :</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class="">Hi swift-evolution,</div><div class=""><br class=""></div><div class="">A short string-related pitch for you.</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><h1 id="addunicodescalarspropertytocharacter" class="" style="box-sizing: border-box; font-size: 2.25em; margin-right: 0px; margin-bottom: 16px; margin-left: 0px; line-height: 1.2; position: relative; color: rgb(51, 51, 51); padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); font-family: helvetica, arial, freesans, clean, sans-serif; background-color: rgb(255, 255, 255); margin-top: 0px !important;">Add <code class="" style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 30.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;">unicodeScalars</code> property to <code class="" style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 30.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;">Character</code></h1><h1 id="addunicodescalarspropertytocharacter" class="" style="box-sizing: border-box; font-size: 2.25em; margin-right: 0px; margin-bottom: 16px; margin-left: 0px; line-height: 1.2; position: relative; color: rgb(51, 51, 51); padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); font-family: helvetica, arial, freesans, clean, sans-serif; background-color: rgb(255, 255, 255); margin-top: 0px !important;"><ul class="" style="box-sizing: border-box; padding: 0px 0px 0px 2em; margin-top: 0px; margin-bottom: 16px; font-size: 16px; font-weight: normal;"><li class="" style="box-sizing: border-box;">Proposal: <a href="file:///Users/ben/src/evolution/proposals/NNNN-character-unicode-view.md" class="" style="box-sizing: border-box; background-color: transparent; color: rgb(65, 131, 196); text-decoration: none;">SE-NNNN</a></li><li class="" style="box-sizing: border-box;">Authors: <a href="https://github.com/airspeedswift" class="" style="box-sizing: border-box; background-color: transparent; color: rgb(65, 131, 196); text-decoration: none;">Ben Cohen</a></li><li class="" style="box-sizing: border-box;">Review Manager: TBD</li><li class="" style="box-sizing: border-box;">Status: <strong class="" style="box-sizing: border-box;">Awaiting review</strong></li></ul></h1><h2 id="introduction" class="" style="box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.225; font-size: 1.75em; position: relative; color: rgb(51, 51, 51); padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); font-family: helvetica, arial, freesans, clean, sans-serif; background-color: rgb(255, 255, 255);">Introduction</h2><h1 class="" style="box-sizing: border-box; font-size: 2.25em; margin-right: 0px; margin-bottom: 16px; margin-left: 0px; line-height: 1.2; position: relative; color: rgb(51, 51, 51); padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); font-family: helvetica, arial, freesans, clean, sans-serif; background-color: rgb(255, 255, 255); margin-top: 0px !important;"><p class="" style="box-sizing: border-box; margin: 0px 0px 16px; font-size: 16px; font-weight: normal;">This proposal adds a <code class="" style="box-sizing: border-box; font-family: 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;">unicodeScalar</code> view to <code class="" style="box-sizing: border-box; font-family: 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;">Character</code>, similar to that on <code class="" style="box-sizing: border-box; font-family: 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;">String</code>.</p></h1><h2 id="motivation" class="" style="box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.225; font-size: 1.75em; position: relative; color: rgb(51, 51, 51); padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); font-family: helvetica, arial, freesans, clean, sans-serif; background-color: rgb(255, 255, 255);">Motivation</h2><h1 class="" style="box-sizing: border-box; font-size: 2.25em; margin-right: 0px; margin-bottom: 16px; margin-left: 0px; line-height: 1.2; position: relative; color: rgb(51, 51, 51); padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); font-family: helvetica, arial, freesans, clean, sans-serif; background-color: rgb(255, 255, 255); margin-top: 0px !important;"><p class="" style="box-sizing: border-box; margin: 0px 0px 16px; font-size: 16px; font-weight: normal;">The <code class="" style="box-sizing: border-box; font-family: 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;">Character</code> element type of <code class="" style="box-sizing: border-box; font-family: 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;">String</code> is currently a black box that provides little functionality besides comparison, literal construction, and to be used as an argument to <code class="" style="box-sizing: border-box; font-family: 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;">String.init</code>.</p><p class="" style="box-sizing: border-box; margin: 0px 0px 16px; font-size: 16px; font-weight: normal;">Many operations on <code class="" style="box-sizing: border-box; font-family: 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;">String</code> could be neatly/readbily implemented as operations on each character in the string, if <code class="" style="box-sizing: border-box; font-family: 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;">Character</code> exposed its scalars more directly. Many useful things can be determined by examining the scalars in a grapheme (for example is this an ASCII character?).</p><p class="" style="box-sizing: border-box; margin: 0px 0px 16px; font-size: 16px; font-weight: normal;">For example, in Swift 4 you can write this:</p><pre class="" style="box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.600000381469727px; margin-top: 0px; margin-bottom: 16px; font-weight: normal; font-stretch: normal; line-height: 1.45; padding: 16px; background-color: rgb(248, 248, 248); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: normal; tab-size: 4; height: 86px;"><code class="swift hljs" style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; padding: 0.5em; margin: 0px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; border: 0px; display: block; overflow-x: auto; line-height: inherit; word-wrap: normal; height: auto;"><span class="hljs-keyword" style="box-sizing: border-box; font-weight: bold;">let</span> s = <span class="hljs-string" style="box-sizing: border-box; color: rgb(221, 17, 68);">"one two three"</span>
s.<span class="hljs-built_in" style="box-sizing: border-box; color: rgb(0, 134, 179);">index</span>(of: <span class="hljs-string" style="box-sizing: border-box; color: rgb(221, 17, 68);">" "</span>)</code></pre><p class="" style="box-sizing: border-box; margin: 0px 0px 16px; font-size: 16px; font-weight: normal;">But you cannot write this:</p><pre class="" style="box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.600000381469727px; margin-top: 0px; margin-bottom: 16px; font-weight: normal; font-stretch: normal; line-height: 1.45; padding: 16px; background-color: rgb(248, 248, 248); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: normal; tab-size: 4; height: 86px;"><code class="swift hljs" style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; padding: 0.5em; margin: 0px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; border: 0px; display: block; overflow-x: auto; line-height: inherit; word-wrap: normal; height: auto;"><span class="hljs-keyword" style="box-sizing: border-box; font-weight: bold;">let</span> ws = <span class="hljs-type" style="box-sizing: border-box; color: rgb(68, 85, 136); font-weight: bold;">CharacterSet</span>.whitespacesAndNewlines
s.<span class="hljs-built_in" style="box-sizing: border-box; color: rgb(0, 134, 179);">index</span> { $<span class="hljs-number" style="box-sizing: border-box; color: rgb(0, 128, 128);">0</span>.unicodeScalars.<span class="hljs-built_in" style="box-sizing: border-box; color: rgb(0, 134, 179);">contains</span>(<span class="hljs-keyword" style="box-sizing: border-box; font-weight: bold;">where</span>: ws.<span class="hljs-built_in" style="box-sizing: border-box; color: rgb(0, 134, 179);">contains</span>) }</code></pre></h1><h2 id="proposedsolution" class="" style="box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.225; font-size: 1.75em; position: relative; color: rgb(51, 51, 51); padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); font-family: helvetica, arial, freesans, clean, sans-serif; background-color: rgb(255, 255, 255);">Proposed solution</h2><h1 class="" style="box-sizing: border-box; font-size: 2.25em; margin-right: 0px; margin-bottom: 16px; margin-left: 0px; line-height: 1.2; position: relative; color: rgb(51, 51, 51); padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); font-family: helvetica, arial, freesans, clean, sans-serif; background-color: rgb(255, 255, 255); margin-top: 0px !important;"><p class="" style="box-sizing: border-box; margin: 0px 0px 16px; font-size: 16px; font-weight: normal;">Add a <code class="" style="box-sizing: border-box; font-family: 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;">unicodeScalars</code> property to <code class="" style="box-sizing: border-box; font-family: 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;">Character</code>, presending a lazy view of the scalars in the character, along similar lines to the one on <code class="" style="box-sizing: border-box; font-family: 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;">String</code>.</p><p class="" style="box-sizing: border-box; margin: 0px 0px 16px; font-size: 16px; font-weight: normal;">Unlike the view on <code class="" style="box-sizing: border-box; font-family: 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;">String</code>, this will <em class="" style="box-sizing: border-box;">not</em> be a mutable view – it will be read-only. The preferred method for creating and manipulating non-literal <code class="" style="box-sizing: border-box; font-family: 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;">Character</code> values will be through <code class="" style="box-sizing: border-box; font-family: 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;">String</code>. While there may be some good use cases to manipulating a <code class="" style="box-sizing: border-box; font-family: 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;">Character</code> directly, these are outweighed by the complexity of ensuring the invariant that it contain exactly one grapheme.</p></h1><h2 id="detaileddesign" class="" style="box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.225; font-size: 1.75em; position: relative; color: rgb(51, 51, 51); padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); font-family: helvetica, arial, freesans, clean, sans-serif; background-color: rgb(255, 255, 255);">Detailed design</h2><h1 class="" style="box-sizing: border-box; font-size: 2.25em; margin-right: 0px; margin-bottom: 16px; margin-left: 0px; line-height: 1.2; position: relative; color: rgb(51, 51, 51); padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); font-family: helvetica, arial, freesans, clean, sans-serif; background-color: rgb(255, 255, 255); margin-top: 0px !important;"><p class="" style="box-sizing: border-box; margin: 0px 0px 16px; font-size: 16px; font-weight: normal;">Add the following nested type to <code class="" style="box-sizing: border-box; font-family: 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;">Character</code>:</p><pre class="" style="box-sizing: border-box; overflow: auto; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.600000381469727px; margin-top: 0px; margin-bottom: 16px; font-weight: normal; font-stretch: normal; line-height: 1.45; padding: 16px; background-color: rgb(248, 248, 248); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-wrap: normal; tab-size: 4; height: 246px;"><code class="swift hljs" style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; padding: 0.5em; margin: 0px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; border: 0px; display: block; overflow-x: auto; line-height: inherit; word-wrap: normal; height: auto;"><span class="hljs-class" style="box-sizing: border-box;"><span class="hljs-keyword" style="box-sizing: border-box; font-weight: bold;">extension</span> <span class="hljs-title" style="box-sizing: border-box; color: rgb(68, 85, 136); font-weight: bold;">Character</span> </span>{
<span class="hljs-keyword" style="box-sizing: border-box; font-weight: bold;">public</span> <span class="hljs-class" style="box-sizing: border-box;"><span class="hljs-keyword" style="box-sizing: border-box; font-weight: bold;">struct</span> <span class="hljs-title" style="box-sizing: border-box; color: rgb(68, 85, 136); font-weight: bold;">UnicodeScalarView</span> : <span class="hljs-title" style="box-sizing: border-box; color: rgb(68, 85, 136); font-weight: bold;">BidirectionalCollection</span> </span>{
<span class="hljs-keyword" style="box-sizing: border-box; font-weight: bold;">public</span> <span class="hljs-class" style="box-sizing: border-box;"><span class="hljs-keyword" style="box-sizing: border-box; font-weight: bold;">struct</span> <span class="hljs-title" style="box-sizing: border-box; color: rgb(68, 85, 136); font-weight: bold;">Index</span>
<span class="hljs-title" style="box-sizing: border-box; color: rgb(68, 85, 136); font-weight: bold;">public</span> <span class="hljs-title" style="box-sizing: border-box; color: rgb(68, 85, 136); font-weight: bold;">var</span> <span class="hljs-title" style="box-sizing: border-box; color: rgb(68, 85, 136); font-weight: bold;">startIndex</span>: <span class="hljs-title" style="box-sizing: border-box; color: rgb(68, 85, 136); font-weight: bold;">Index</span>
<span class="hljs-title" style="box-sizing: border-box; color: rgb(68, 85, 136); font-weight: bold;">public</span> <span class="hljs-title" style="box-sizing: border-box; color: rgb(68, 85, 136); font-weight: bold;">var</span> <span class="hljs-title" style="box-sizing: border-box; color: rgb(68, 85, 136); font-weight: bold;">endIndex</span>: <span class="hljs-title" style="box-sizing: border-box; color: rgb(68, 85, 136); font-weight: bold;">Index</span>
<span class="hljs-title" style="box-sizing: border-box; color: rgb(68, 85, 136); font-weight: bold;">public</span> <span class="hljs-title" style="box-sizing: border-box; color: rgb(68, 85, 136); font-weight: bold;">func</span> <span class="hljs-title" style="box-sizing: border-box; color: rgb(68, 85, 136); font-weight: bold;">index</span>(<span class="hljs-title" style="box-sizing: border-box; color: rgb(68, 85, 136); font-weight: bold;">after</span> <span class="hljs-title" style="box-sizing: border-box; color: rgb(68, 85, 136); font-weight: bold;">i</span>: <span class="hljs-title" style="box-sizing: border-box; color: rgb(68, 85, 136); font-weight: bold;">Index</span>) -> <span class="hljs-title" style="box-sizing: border-box; color: rgb(68, 85, 136); font-weight: bold;">Index</span>
<span class="hljs-title" style="box-sizing: border-box; color: rgb(68, 85, 136); font-weight: bold;">public</span> <span class="hljs-title" style="box-sizing: border-box; color: rgb(68, 85, 136); font-weight: bold;">func</span> <span class="hljs-title" style="box-sizing: border-box; color: rgb(68, 85, 136); font-weight: bold;">index</span>(<span class="hljs-title" style="box-sizing: border-box; color: rgb(68, 85, 136); font-weight: bold;">before</span> <span class="hljs-title" style="box-sizing: border-box; color: rgb(68, 85, 136); font-weight: bold;">i</span>: <span class="hljs-title" style="box-sizing: border-box; color: rgb(68, 85, 136); font-weight: bold;">Index</span>)
<span class="hljs-title" style="box-sizing: border-box; color: rgb(68, 85, 136); font-weight: bold;">public</span> <span class="hljs-title" style="box-sizing: border-box; color: rgb(68, 85, 136); font-weight: bold;">subscript</span>(<span class="hljs-title" style="box-sizing: border-box; color: rgb(68, 85, 136); font-weight: bold;">i</span>: <span class="hljs-title" style="box-sizing: border-box; color: rgb(68, 85, 136); font-weight: bold;">Index</span>) -> <span class="hljs-title" style="box-sizing: border-box; color: rgb(68, 85, 136); font-weight: bold;">UnicodeScalar</span>
}
}</span></code></pre><p class="" style="box-sizing: border-box; margin: 0px 0px 16px; font-size: 16px; font-weight: normal;">Additionally, this type will conform to appropriate convenience protocols such as <code class="" style="box-sizing: border-box; font-family: 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;">CustomStringConvertible</code>.</p><p class="" style="box-sizing: border-box; margin: 0px 0px 16px; font-size: 16px; font-weight: normal;">All initializers will be declared internal, as unlike the <code class="" style="box-sizing: border-box; font-family: 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;">String</code> equivalent, this type will only ever be vended by <code class="" style="box-sizing: border-box; font-family: 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;">Character</code>.</p></h1><h2 id="sourcecompatibility" class="" style="box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.225; font-size: 1.75em; position: relative; color: rgb(51, 51, 51); padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); font-family: helvetica, arial, freesans, clean, sans-serif; background-color: rgb(255, 255, 255);">Source compatibility</h2><h1 class="" style="box-sizing: border-box; font-size: 2.25em; margin-right: 0px; margin-bottom: 16px; margin-left: 0px; line-height: 1.2; position: relative; color: rgb(51, 51, 51); padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); font-family: helvetica, arial, freesans, clean, sans-serif; background-color: rgb(255, 255, 255); margin-top: 0px !important;"><p class="" style="box-sizing: border-box; margin: 0px 0px 16px; font-size: 16px; font-weight: normal;">Purely additive, so no impact.</p></h1><h2 id="effectonabistability" class="" style="box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.225; font-size: 1.75em; position: relative; color: rgb(51, 51, 51); padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); font-family: helvetica, arial, freesans, clean, sans-serif; background-color: rgb(255, 255, 255);">Effect on ABI stability</h2><h1 class="" style="box-sizing: border-box; font-size: 2.25em; margin-right: 0px; margin-bottom: 16px; margin-left: 0px; line-height: 1.2; position: relative; color: rgb(51, 51, 51); padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); font-family: helvetica, arial, freesans, clean, sans-serif; background-color: rgb(255, 255, 255); margin-top: 0px !important;"><p class="" style="box-sizing: border-box; margin: 0px 0px 16px; font-size: 16px; font-weight: normal;">Purely additive, so no impact.</p></h1><h2 id="effectonapiresilience" class="" style="box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.225; font-size: 1.75em; position: relative; color: rgb(51, 51, 51); padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); font-family: helvetica, arial, freesans, clean, sans-serif; background-color: rgb(255, 255, 255);">Effect on API resilience</h2><h1 class="" style="box-sizing: border-box; font-size: 2.25em; margin-right: 0px; margin-bottom: 16px; margin-left: 0px; line-height: 1.2; position: relative; color: rgb(51, 51, 51); padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); font-family: helvetica, arial, freesans, clean, sans-serif; background-color: rgb(255, 255, 255); margin-top: 0px !important;"><p class="" style="box-sizing: border-box; margin: 0px 0px 16px; font-size: 16px; font-weight: normal;">Purely additive, so no impact.</p></h1><h2 id="alternativesconsidered" class="" style="box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.225; font-size: 1.75em; position: relative; color: rgb(51, 51, 51); padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); font-family: helvetica, arial, freesans, clean, sans-serif; background-color: rgb(255, 255, 255);">Alternatives considered</h2><h1 class="" style="box-sizing: border-box; font-size: 2.25em; margin-right: 0px; margin-bottom: 16px; margin-left: 0px; line-height: 1.2; position: relative; color: rgb(51, 51, 51); padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); font-family: helvetica, arial, freesans, clean, sans-serif; background-color: rgb(255, 255, 255); margin-top: 0px !important;"><p class="" style="box-sizing: border-box; margin: 0px 0px 16px; font-size: 16px; font-weight: normal;">Adding other views, such as <code class="" style="box-sizing: border-box; font-family: 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;">utf8</code> or <code class="" style="box-sizing: border-box; font-family: 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;">utf16</code>, was considered but not deemed useful enough compared to using these operations on <code class="" style="box-sizing: border-box; font-family: 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;">String</code> instead.</p><div class="" style="box-sizing: border-box; margin-top: 0px; margin-right: 0px; margin-left: 0px; font-size: 16px; font-weight: normal; margin-bottom: 0px !important;">In future, this feature could be used to implement convenience methods such as <code class="" style="box-sizing: border-box; font-family: 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;">isASCII</code> on <code class="" style="box-sizing: border-box; font-family: 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;">Character</code>. This could be done additively, given this building block, and is outside the scope of this initial proposal.</div></h1></div><div class=""><br class=""></div></div>_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></blockquote></div><br class=""></div></body></html>