<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif">Also note that we&#39;d still need raw strings that don&#39;t parse escapes but still perform indentation erasure. There have been several use cases presented in this thread that would require it, so we&#39;d still end up needing three string literal styles.</div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif">-Travis Tilley</div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Dec 12, 2015 at 2:02 AM, Alex Gordon <span dir="ltr">&lt;<a href="mailto:alextgordon@gmail.com" target="_blank">alextgordon@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>What is the reason that normal strings &quot;...&quot; don&#39;t support newlines? It&#39;s not traditionally seen in C-inspired languages, but it&#39;s hardly unusual outside that sphere[*]. Ruby and HTML are probably the most common examples, but apparently OCaml and Lisps also allow it?</div><div><br></div><div>Then we can simply use</div><div><br></div><div>1. &quot;...&quot; strings as the verbatim literal, preserving indentation and leading newlines as written.</div><div><br></div><div>2. &quot;&quot;&quot;...&quot;&quot;&quot; strings as the non-verbatim literal, reducing indentation to that of the least indented line, and removing the leading newline if it exists.</div><div><br></div><div>[*] As seen earlier <a href="http://rigaux.org/language-study/syntax-across-languages.html#StrngMltLine" target="_blank">http://rigaux.org/language-study/syntax-across-languages.html#StrngMltLine</a></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Sat, Dec 12, 2015 at 6:25 AM, Travis Tilley 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></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div style="font-family:verdana,sans-serif"><span style="font-family:arial,sans-serif">That&#39;s another great example that I hadn&#39;t even thought of.</span></div><div style="font-family:verdana,sans-serif"><span style="font-family:arial,sans-serif"><br></span></div><div style="font-family:verdana,sans-serif"><span style="font-family:arial,sans-serif"><br></span></div><div style="font-family:verdana,sans-serif"><span style="font-family:arial,sans-serif">- Travis Tilley</span></div><div style="font-family:verdana,sans-serif"><span style="font-family:arial,sans-serif"><br></span></div><div style="font-family:verdana,sans-serif"><span style="font-family:arial,sans-serif"><br></span></div><div style="font-family:verdana,sans-serif"><span style="font-family:arial,sans-serif">On Fri, Dec 11, 2015 at 7:43 PM, Jason Dusek </span><span dir="ltr" style="font-family:arial,sans-serif">&lt;<a href="mailto:jason.dusek@gmail.com" target="_blank">jason.dusek@gmail.com</a>&gt;</span><span style="font-family:arial,sans-serif"> wrote:</span><br></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><span><p style="margin:1.2em 0px!important">One use case for a slightly richer approach to indentation erasure — one that I encounter every day — is inline SQL. If it’s 10 lines or more, it should probably find expression as a <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);border-radius:3px;display:inline;background-color:rgb(248,248,248)">VIEW</code> or stored procedure; but queries like this are not unusual:<br></p></span>
<pre style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;font-size:1em;line-height:1.2em;margin:1.2em 0px"><code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);border-radius:3px;display:inline;background-color:rgb(248,248,248);white-space:pre-wrap;overflow:auto;border-radius:3px;border:1px solid rgb(204,204,204);padding:0.5em 0.7em;display:block!important;display:block;overflow-x:auto;padding:0.5em;color:rgb(51,51,51);background:rgb(248,248,248)"><span><span style="color:rgb(51,51,51);font-weight:bold">func</span> <span style="color:rgb(153,0,0);font-weight:bold">findMentions</span><span>(account: String)</span> -&gt; <span style="color:rgb(153,0,0);font-weight:bold">Array</span><span>&lt;String&gt;</span> </span>{
    <span style="color:rgb(51,51,51);font-weight:bold">let</span> db = databaseFactory().findDatabase()
    <span style="color:rgb(51,51,51);font-weight:bold">let</span> q = `​``<span style="color:rgb(68,85,136);font-weight:bold">SELECT</span> array_agg(<a href="http://mentioner.id" target="_blank">mentioner.id</a>)
                 <span style="color:rgb(68,85,136);font-weight:bold">FROM</span> account
                 <span style="color:rgb(68,85,136);font-weight:bold">JOIN</span> mention <span style="color:rgb(68,85,136);font-weight:bold">ON</span> (<a href="http://account.id" target="_blank">account.id</a> = mentioned)
                 <span style="color:rgb(68,85,136);font-weight:bold">JOIN</span> account <span style="color:rgb(68,85,136);font-weight:bold">AS</span> mentioner <span style="color:rgb(68,85,136);font-weight:bold">ON</span> (<a href="http://mentioner.id" target="_blank">mentioner.id</a> = mentioner)
                <span style="color:rgb(68,85,136);font-weight:bold">WHERE</span> account.handle = :<span style="color:rgb(0,128,128)">1</span>
                <span style="color:rgb(68,85,136);font-weight:bold">ORDER</span> <span style="color:rgb(68,85,136);font-weight:bold">BY</span> timestamp <span style="color:rgb(68,85,136);font-weight:bold">DESC</span>
                <span style="color:rgb(68,85,136);font-weight:bold">LIMIT</span> <span style="color:rgb(0,128,128)">1</span>`​``

    <span style="color:rgb(51,51,51);font-weight:bold">return</span> db.query(q).parameterize(account).run()
}
</code></pre>
<p style="margin:1.2em 0px!important">Moving everything below <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);border-radius:3px;display:inline;background-color:rgb(248,248,248)">q</code> seems infelicitous, at best. However, I do see the appeal of basing the rule on the position of the backticks.</p>
<p style="margin:1.2em 0px!important">Best Regards,</p><p style="margin:1.2em 0px!important">Jason Dusek</p></div></blockquote><div> </div></div>
</div></div>
</div></div><span class=""><img src="https://u2002410.ct.sendgrid.net/wf/open?upn=ufQ1sKmNNtjEC-2BBUON-2BgZPd8t-2F4PFTin0qlI9lRM0AlI2I3pNy2PX4maTqYBy7ZknqADue9VJ1l1LYgn-2BokspEFOrXcJ8-2BaRpStVNA1SVTwxLUYE97lepIm49101-2FSys92h5oy45p-2Bn9sAP5Vw1skI3eeqqOJRo5ocCKWzxlgPk6id9EE-2F2-2FSIjvMAMvza0Sj1XFnwt8N5mmnhz3-2BMuqXBWqlTHZ4UYLh-2FOVtQLNfYY-3D" alt="" width="1" height="1" border="0" style="min-height:1px!important;width:1px!important;border-width:0!important;margin-top:0!important;margin-bottom:0!important;margin-right:0!important;margin-left:0!important;padding-top:0!important;padding-bottom:0!important;padding-right:0!important;padding-left:0!important">
<br>_______________________________________________<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></span></blockquote></div></div></blockquote></div>
</div></div>