<div>Not dealing with trailing whitespaces is indeed the right decision, I think. The idea has always been that one key advantage for this syntax is that one can copy and paste the greatest possible amount of multi-line text without having to edit each line.</div><div><br></div><div>Many source documents can have such trailing spaces at the end of lines. For example, I'm sure that some of the HTML documents I've written, unless linted, have such spaces. They are both invisible and harmless in the original source document.</div><div><br></div><div>They would also do no harm in a multi-line literal. There is no need to warn or error in that scenario, and the proposed workaround requires a rather ugly escape pattern to cure this non-harm.</div><div><br></div><div><br><div class="gmail_quote"><div>On Wed, Apr 19, 2017 at 16:43 Adrian Zubarev via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div class="m_-948619793887589896bloop_markdown"><p>First of all, thank you for accepting the proposal. However I still have one single concern left about the trailing whitespaces. Will the final implemented version raise a warning or produce an error when there are trailing whitespaces?</p>
<p>The whole idea of a trailing <code>\</code> was in first place to prevent new line injection but also for trailing whitespace character precision.</p>
<p>The following example could have 1000 characters, but a different developer who reads the code wouldn’t even notice.</p>
<pre><code class="m_-948619793887589896swift">"""
Foo<space><space>…<space>
Bar
"""
</code></pre>
<p>That’s what the trailing backslash was meant for. To prevent unwanted whitespaces, or if you really need them, to force you to be precise about them.</p>
<pre><code class="m_-948619793887589896swift">"""
Foo<space><space><space>\n\
Bar
"""
</code></pre>
<p></p></div><div class="m_-948619793887589896bloop_original_html"><div id="m_-948619793887589896bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto"><br></div> <br> <div id="m_-948619793887589896bloop_sign_1492637713315290880" class="m_-948619793887589896bloop_sign"><div style="font-family:helvetica,arial;font-size:13px">-- <br>Adrian Zubarev<br>Sent with Airmail</div></div></div></div><div style="word-wrap:break-word"><div class="m_-948619793887589896bloop_original_html"> <br><p class="m_-948619793887589896airmail_on">Am 19. April 2017 um 22:03:31, Joe Groff via swift-evolution (<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>) schrieb:</p> <blockquote type="cite" class="m_-948619793887589896clean_bq"><span><div><span style="color:rgb(0,0,0);font-family:helvetica;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;display:inline!important;float:none">- It should be clarified that<span class="m_-948619793887589896Apple-converted-space"> </span></span><b style="color:rgb(0,0,0);font-family:helvetica;font-size:13px;font-style:normal;font-variant-caps:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">multiline strings support the same escapes and interpolations</b><span style="color:rgb(0,0,0);font-family:helvetica;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;display:inline!important;float:none"> as single-line strings. This allows a literal """ to be written \""". Discussion on the list raised the idea of allowing a line to end with \ to "escape" the newline and elide it from the value of the literal; the core team had concerns about only allowing that inside multi-line literals and felt that that could also be considered later as an additive feature.</span></div></span></blockquote></div></div><div style="word-wrap:break-word"><div class="m_-948619793887589896bloop_original_html"></div><div class="m_-948619793887589896bloop_markdown"><p></p></div></div>_______________________________________________<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" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
</blockquote></div></div>