<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Tue, May 16, 2017 at 6:47 AM Adrian Zubarev via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt; 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_196942562752481699bloop_markdown"><p>Well the main complain I had during the discussion with David was, that I previously had such a model in mind which will break up long double-quoted string literals. Please look up this design in the alternative section of our proposal. By adding slightly redundant multi-line string literal syntax for consistency renders that complain to zero. By allowing:</p></div></div><div style="word-wrap:break-word"><div class="m_196942562752481699bloop_markdown">

<pre><code>&quot;
SELECT &#39;name&#39;
FROM &#39;people&#39;
WHERE age &gt; 20
&quot;
</code></pre>

</div></div><div style="word-wrap:break-word"><div class="m_196942562752481699bloop_markdown"><p>it becomes clear that the trailing backslash should only be used for escaping new line injection in multi-line string literals, but not for breaking up long strings (similar to other languages like JavaScript):</p></div></div><div style="word-wrap:break-word"><div class="m_196942562752481699bloop_markdown">

<pre><code>&quot;SELECT &#39;name&#39; \
FROM &#39;people&#39; \
WHERE age &gt; 20&quot;
</code></pre>

</div></div><div style="word-wrap:break-word"><div class="m_196942562752481699bloop_markdown"><p>This also lets us adopt the C/Objective-C syntax instead. </p></div></div><div style="word-wrap:break-word"><div class="m_196942562752481699bloop_markdown">

<pre><code>&quot;SELECT &#39;name&#39; &quot;
&quot;FROM &#39;people&#39; &quot;
&quot;WHERE age &gt; 20&quot;</code></pre></div></div></blockquote><div>Regarding the C/Objective-C syntax, what would be the advantages over concatenating the strings with `+`? All I can see is that it saves two characters per line—is that sufficient to warrant adding another way of doing the same thing? They&#39;re available in C/Obj-C because `+` for string literals *wasn&#39;t* available, but since Swift does support `+` for string literals, I think it&#39;s hard to rationalize adding this.</div><div><br></div><div> </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_196942562752481699bloop_original_html"><div id="m_196942562752481699bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto"></div> <br> <div id="m_196942562752481699bloop_sign_1494941155072862208" class="m_196942562752481699bloop_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_196942562752481699bloop_original_html"> <br><p class="m_196942562752481699airmail_on">Am 16. Mai 2017 um 15:02:06, Gwendal Roué via swift-evolution (<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>) schrieb:</p> <blockquote type="cite" class="m_196942562752481699clean_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">I wonder whether this addition was introduced in order to make the proposal as consistent as possible, and prevent some criticisms. It has proven pointless. I suggest forgetting about pleasing people who don&#39;t want to be pleased, and to reconsider this &quot;divorce&quot; section. Consistency is not the main point. The main point is UX. This means easing the daily life of code writers, and easing the daily life of code readers (this involves being careful which text editors and code prettyfiers are unable to handle the proposal).</span><br 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"><br 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"><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">&gt; Support escaping newlines in multi-line strings with a trailing \</span><br 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"><br 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"><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">Great. That&#39;s the main request, unless I&#39;m misled: split long literals accross multiple lines.<span class="m_196942562752481699Apple-converted-space"> </span></span><br 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"><br 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"><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">Now that Xiaodi Wu has found them, the core team questions about the trailing backslash should be addressed in more details.</span><br 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"><br 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"><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">&gt; Adopt the C/Objective-C syntax that concatenates single-line strings</span><br 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"><br 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"><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">A battle-tested solution. Doesn&#39;t it look redundant with both the &quot;divorce&quot; and the trailing backslash?</span></div></span></blockquote></div></div><div style="word-wrap:break-word"><div class="m_196942562752481699bloop_original_html"></div><div class="m_196942562752481699bloop_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>