<div dir="ltr">We had a very full debate about which way was superior during review; it was proposed to behave one way and the core team decided on the other. We have to let settled decisions be settled: that&#39;s the only way Swift Evolution will continue to work.<div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 19, 2017 at 5:15 PM, Kevin Nattinger via swift-evolution <span dir="ltr">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">I agree, but unfortunately it’s probably too late now.<div><div class="h5"><div><br><div><blockquote type="cite"><div>On Apr 19, 2017, at 3:11 PM, Martin Waitz via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt; wrote:</div><br class="m_-1153828080461882838Apple-interchange-newline"><div><div style="word-wrap:break-word"><div>Hi,</div><div><br></div><div>I think, it would be more natural to include the last newline.</div><div>Multi-line String literals are for multiple lines.</div><div>And each line ends in a <span style="font-family:Menlo;background-color:rgb(255,255,255)">\n</span><span style="background-color:rgb(255,255,255)">. Otherwise it wouldn’t be a line.</span></div><div><br></div><div>Having</div><div><div style="margin:0px;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures">    &quot;&quot;&quot;</span></div><div style="margin:0px;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures">    line 1</span></div><div style="margin:0px;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures">    &quot;&quot;&quot;</span></div><div style="margin:0px;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures">    +</span></div><div style="margin:0px;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures">    &quot;&quot;&quot;</span></div><div style="margin:0px;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures">    line 2</span></div><div style="margin:0px;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures">    &quot;&quot;&quot;</span></div><div style="margin:0px;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures">    ==</span></div><div style="margin:0px;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures">    &quot;&quot;&quot;</span></div><div style="margin:0px;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures">    line 1</span></div><div style="margin:0px;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures">    line 2</span></div><div style="margin:0px;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures">    &quot;&quot;&quot;</span></div></div><div><span style="font-variant-ligatures:no-common-ligatures"><br></span></div><div>makes a lot of sense to me.</div><div><br></div><div>Or do we want to magically add a trailing newline everywhere as we do in print()?</div><div>Better change print to only add the newline when necessary! (e.g. by adding a new parameter which defaults to „auto“)</div><div><br></div><div>— </div><div>Martin</div><br><div><blockquote type="cite"><div>Am 19.04.2017 um 23:51 schrieb Adrian Zubarev via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt;:</div><br class="m_-1153828080461882838Apple-interchange-newline"><div><div class="m_-1153828080461882838bloop_markdown" style="font-family:Helvetica,Arial;font-size:13px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(254,254,254)"><p style="margin:15px 0px">This is the natural way of text blocks. If you really need a blank line you can add one at the start/end or alternatively use<span class="m_-1153828080461882838Apple-converted-space"> </span><code style="font-family:Menlo,Consolas,&#39;Liberation Mono&#39;,Courier,monospace;font-size:10pt;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;background-color:rgb(248,248,248);color:inherit;border:1px solid rgb(234,234,234);margin:0px 2px;padding:0px 5px;word-break:normal;word-wrap:normal">\n</code>.</p><pre style="margin:15px 0px;font-family:Menlo,Consolas,&#39;Liberation Mono&#39;,Courier,monospace;font-size:10pt;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;background-color:rgb(248,248,248);color:inherit;border:1px solid rgb(204,204,204);overflow:auto;padding:4px 8px;word-break:normal;word-wrap:normal"><code class="m_-1153828080461882838swift" style="font-family:Menlo,Consolas,&#39;Liberation Mono&#39;,Courier,monospace;font-size:10pt;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;background-color:rgb(248,248,248);color:inherit;border:0px;margin:0px;padding:0px;word-break:normal;word-wrap:normal">&quot;&quot;&quot;

Foo  

&quot;&quot;&quot;

// Equals &quot;\nFoo\n&quot;
</code></pre><div style="margin:15px 0px"><br class="m_-1153828080461882838webkit-block-placeholder"></div></div><div class="m_-1153828080461882838bloop_original_html" style="font-family:Helvetica,Arial;font-size:13px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(254,254,254)"><div id="m_-1153828080461882838bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;margin:0px"><br></div><br><div id="m_-1153828080461882838bloop_sign_1492638545923299072" class="m_-1153828080461882838bloop_sign"><div style="font-family:helvetica,arial;font-size:13px">-- <br>Adrian Zubarev<br>Sent with Airmail</div></div><br><p class="m_-1153828080461882838airmail_on" style="margin:15px 0px">Am 19. April 2017 um 22:53:07, Vladimir.S via swift-evolution (<a href="mailto:swift-evolution@swift.org" style="color:rgb(65,131,196);background-color:inherit;text-decoration:none" target="_blank">swift-evolution@swift.org</a>) schrieb:</p><blockquote type="cite" class="m_-1153828080461882838clean_bq" style="margin:15px 0px"><span style="margin-top:0px;margin-bottom:0px"><div><div></div><div>On 19.04.2017 23:03, Joe Groff via swift-evolution wrote:<br>&gt; Proposal Link:<span class="m_-1153828080461882838Apple-converted-space"> </span><br>&gt; <a href="https://github.com/apple/swift-evolution/blob/master/proposals/0168-multi-line-string-literals.md" target="_blank">https://github.com/apple/<wbr>swift-evolution/blob/master/<wbr>proposals/0168-multi-line-<wbr>string-literals.md</a><br>&gt;<span class="m_-1153828080461882838Apple-converted-space"> </span><br>&gt; Hello Swift Community,<br>&gt;<span class="m_-1153828080461882838Apple-converted-space"> </span><br>&gt; The review of SE-0168: &quot;Multi-Line String Literals&quot; ran from April 6...12, 2017. The<span class="m_-1153828080461882838Apple-converted-space"> </span><br>&gt; proposal is *accepted with revisions. *Community feedback was largely positive on the<span class="m_-1153828080461882838Apple-converted-space"> </span><br>&gt; idea, though the discussion highlighted several under-specified aspects.<br>&gt;<span class="m_-1153828080461882838Apple-converted-space"> </span><br>&gt; - Questions arose about whether text could appear on the same line as the opening and<span class="m_-1153828080461882838Apple-converted-space"> </span><br>&gt; closing delimiter, and how that would interact with the de-indentation algorithm. The<span class="m_-1153828080461882838Apple-converted-space"> </span><br>&gt; core team feels that it is important to keep this feature focused on its purpose of<span class="m_-1153828080461882838Apple-converted-space"> </span><br>&gt; allowing the easy embedding of pasted blocks of text, so *text inside the literal on<span class="m_-1153828080461882838Apple-converted-space"> </span><br>&gt; the same line as either delimiter should be disallowed.*<br>&gt;<span class="m_-1153828080461882838Apple-converted-space"> </span><br>&gt; // Allowed, equal to &quot;foo\nbar&quot;<br>&gt; &quot;&quot;&quot;<br>&gt; foo<br>&gt; bar<br>&gt; &quot;&quot;&quot;<br><br>Could you clarify, shouldn&#39;t this be equal to &quot;foo\nbar\n&quot; ? I.e. with trailing \n<span class="m_-1153828080461882838Apple-converted-space"> </span><br>for &quot;bar&quot; line?<br>I didn&#39;t find any clarification about the injecting of line-end for last text<span class="m_-1153828080461882838Apple-converted-space"> </span><br>line(not for the &quot;&quot;&quot; delimiter).<br><br>&gt;<span class="m_-1153828080461882838Apple-converted-space"> </span><br>&gt; // Not allowed<br>&gt; &quot;&quot;&quot;foo<br>&gt; bar<br>&gt; &quot;&quot;&quot;<br>&gt;<span class="m_-1153828080461882838Apple-converted-space"> </span><br>&gt; // Not allowed<br>&gt; &quot;&quot;&quot;<br>&gt; foo<br>&gt; bar&quot;&quot;&quot;<br>&gt;<span class="m_-1153828080461882838Apple-converted-space"> </span><br>&gt; This keeps the model straightforward to describe: a *single newline *is always<span class="m_-1153828080461882838Apple-converted-space"> </span><br>&gt; stripped after the opening delimiter and before the closing one, and the closing<span class="m_-1153828080461882838Apple-converted-space"> </span><br>&gt; delimiter&#39;s position always determines the indentation level of the entire literal.<span class="m_-1153828080461882838Apple-converted-space"> </span><br>&gt; The core team acknowledges that single-line triple quoted strings have other uses in<span class="m_-1153828080461882838Apple-converted-space"> </span><br>&gt; other languages, such as to avoid excessive escaping in a string that contains lots<span class="m_-1153828080461882838Apple-converted-space"> </span><br>&gt; of literal quotes, but supporting that alongside the indentation-stripping behavior<span class="m_-1153828080461882838Apple-converted-space"> </span><br>&gt; leads to a lot of subtlety, and there could be other solutions to the escaping<span class="m_-1153828080461882838Apple-converted-space"> </span><br>&gt; problem down the line, such as raw strings. If nothing else, single-line triple<span class="m_-1153828080461882838Apple-converted-space"> </span><br>&gt; quoted strings can be considered later as an additive feature.<br>&gt;<span class="m_-1153828080461882838Apple-converted-space"> </span><br>&gt; - The core team also believes that *underindentation or inconsistent tab/space usage<span class="m_-1153828080461882838Apple-converted-space"> </span><br>&gt; within the indentation should be an error.* Every line inside the literal must begin<span class="m_-1153828080461882838Apple-converted-space"> </span><br>&gt; with the exact sequence of spaces and tabs that precedes the closing delimiter.<br>&gt;<span class="m_-1153828080461882838Apple-converted-space"> </span><br>&gt; &quot;&quot;&quot;<br>&gt; &lt;tab&gt;&lt;space&gt;this is OK<br>&gt; &lt;space&gt;&lt;space&gt;this is an error<br>&gt; &lt;space&gt;&lt;tab&gt;this is also an error<br>&gt; &lt;tab&gt;under-indenting is an error too<br>&gt; &lt;tab&gt;&lt;space&gt;&lt;space&gt;but you can go nuts after the indentation all you want<br>&gt; &lt;tab&gt;&lt;space&gt;&lt;tab&gt;you do you<br>&gt; &lt;tab&gt;&lt;space&gt;&quot;&quot;&quot;<br>&gt;<span class="m_-1153828080461882838Apple-converted-space"> </span><br>&gt; - The quoted string should *normalize newlines* to \n in the value of the literal,<span class="m_-1153828080461882838Apple-converted-space"> </span><br>&gt; regardless of whether the source file uses \n (Unix), \r\n (Windows), or \r (classic<span class="m_-1153828080461882838Apple-converted-space"> </span><br>&gt; Mac) line endings. Likewise, when the compiler strips the initial and final newline<span class="m_-1153828080461882838Apple-converted-space"> </span><br>&gt; from the literal value, it will strip one of any of the \n, \r\n, or \r line-ending<span class="m_-1153828080461882838Apple-converted-space"> </span><br>&gt; sequences from both ends of the literal.<br>&gt;<span class="m_-1153828080461882838Apple-converted-space"> </span><br>&gt; // equal to &quot;foo\nfoo\nfoo\nfoo&quot;<br>&gt; &quot;&quot;&quot;^J<br>&gt; foo^M^J<br>&gt; foo^J<br>&gt; foo^M<br>&gt; foo^M<br>&gt; &quot;&quot;&quot;<br>&gt;<span class="m_-1153828080461882838Apple-converted-space"> </span><br>&gt; - It should be clarified that *multiline strings support the same escapes and<span class="m_-1153828080461882838Apple-converted-space"> </span><br>&gt; interpolations* as single-line strings. This allows a literal &quot;&quot;&quot; to be written \&quot;&quot;&quot;.<span class="m_-1153828080461882838Apple-converted-space"> </span><br>&gt; Discussion on the list raised the idea of allowing a line to end with \ to &quot;escape&quot;<span class="m_-1153828080461882838Apple-converted-space"> </span><br>&gt; the newline and elide it from the value of the literal; the core team had concerns<span class="m_-1153828080461882838Apple-converted-space"> </span><br>&gt; about only allowing that inside multi-line literals and felt that that could also be<span class="m_-1153828080461882838Apple-converted-space"> </span><br>&gt; considered later as an additive feature.<br>&gt;<span class="m_-1153828080461882838Apple-converted-space"> </span><br>&gt; Thanks John, Brent, and Tyler for the original proposal, and thanks to everyone who<span class="m_-1153828080461882838Apple-converted-space"> </span><br>&gt; participated in the discussion!<br>&gt;<span class="m_-1153828080461882838Apple-converted-space"> </span><br>&gt; -Joe<br>&gt; Review Manager<br>&gt;<span class="m_-1153828080461882838Apple-converted-space"> </span><br>&gt;<span class="m_-1153828080461882838Apple-converted-space"> </span><br>&gt; ______________________________<wbr>_________________<br>&gt; swift-evolution mailing list<br>&gt; <a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br>&gt; <a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank">https://lists.swift.org/<wbr>mailman/listinfo/swift-<wbr>evolution</a><br>&gt;<span class="m_-1153828080461882838Apple-converted-space"> </span><br>______________________________<wbr>_________________<br>swift-evolution mailing list<br><a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank">https://lists.swift.org/<wbr>mailman/listinfo/swift-<wbr>evolution</a><br></div></div></span></blockquote></div><div class="m_-1153828080461882838bloop_markdown" style="font-family:Helvetica,Arial;font-size:13px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(254,254,254)"><div style="margin:15px 0px"><br class="m_-1153828080461882838webkit-block-placeholder"></div></div><span style="font-family:Helvetica,Arial;font-size:13px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(254,254,254);float:none;display:inline!important">______________________________<wbr>_________________</span><br style="font-family:Helvetica,Arial;font-size:13px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(254,254,254)"><span style="font-family:Helvetica,Arial;font-size:13px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(254,254,254);float:none;display:inline!important">swift-evolution mailing list</span><br style="font-family:Helvetica,Arial;font-size:13px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(254,254,254)"><a href="mailto:swift-evolution@swift.org" style="color:rgb(65,131,196);background-color:rgb(254,254,254);text-decoration:none;font-family:Helvetica,Arial;font-size:13px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" target="_blank">swift-evolution@swift.org</a><br style="font-family:Helvetica,Arial;font-size:13px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(254,254,254)"><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" style="color:rgb(65,131,196);background-color:rgb(254,254,254);text-decoration:none;font-family:Helvetica,Arial;font-size:13px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" target="_blank">https://lists.swift.org/<wbr>mailman/listinfo/swift-<wbr>evolution</a><br style="font-family:Helvetica,Arial;font-size:13px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(254,254,254)"></div></blockquote></div><br></div>______________________________<wbr>_________________<br>swift-evolution mailing list<br><a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank">https://lists.swift.org/<wbr>mailman/listinfo/swift-<wbr>evolution</a><br></div></blockquote></div><br></div></div></div></div><br>______________________________<wbr>_________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/<wbr>mailman/listinfo/swift-<wbr>evolution</a><br>
<br></blockquote></div><br></div></div>