<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Helvetica;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
        {font-family:Menlo;
        panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
code
        {mso-style-priority:99;
        font-family:"Courier New",serif;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New",serif;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
span.apple-converted-space
        {mso-style-name:apple-converted-space;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;}
span.EmailStyle22
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">(Despite Ben’s claims…)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">Are there no limits on interpolation? I don’t see anything about that in the informal addendum to the undetailed proposal. Will multiline strings in interpolations in normal
string literals enable them to lexically span multiple lines? Based on Swift 3.0.2 accepting this:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New",serif">var x = "single line \( "strings are \( "not normally" ) allowed" ) to span multiple lines"<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">I assume that this would be accepted:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New",serif">var x = "single line \( """
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New",serif"> strings are \( "not normally" ) allowed<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Courier New",serif"> """ ) to span multiple lines"<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">which seems confusingly excessive.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">I have someone implementing a Swift syntax highlighter right now, and we’re trying to anticipate support for multiline strings. It’s vexing in combination with the following
recovery/robustness feature: if you read a lexical newline while in the "-quoted string state, return to the normal code state. (Interpreting " strings as potentially multiline opens the possibility of accidental “inversion” of the remainder of the file in
case of a bug, syntax error, or not-yet-supported language feature. Better to mess up one line than many.)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">Disallowing """ multiline strings in interpolations seems a very reasonable thing to do.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">--
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">Peter Dillinger, Ph.D.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">Software Engineering Manager, Coverity Analysis, Software Integrity Group | Synopsys<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">www.synopsys.com/software<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="margin-left:.5in"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> swift-evolution-bounces@swift.org [mailto:swift-evolution-bounces@swift.org]
<b>On Behalf Of </b>Ben Rimmington via swift-evolution<br>
<b>Sent:</b> Thursday, April 20, 2017 12:12 PM<br>
<b>To:</b> Adrian Zubarev <adrian.zubarev@devandartist.com><br>
<b>Cc:</b> swift-evolution <swift-evolution@swift.org><br>
<b>Subject:</b> Re: [swift-evolution] [Accepted] SE-0168: Multi-Line String Literals<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
<div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal" style="margin-left:.5in">On 20 Apr 2017, at 17:48, Adrian Zubarev wrote:<o:p></o:p></p>
</div>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
<div>
<p class="MsoNormal" style="margin-left:.5in;font-variant-caps: normal;text-align:start;-webkit-text-stroke-width: 0px;word-spacing:0px">
<span style="font-size:10.0pt;font-family:"Helvetica",sans-serif">Some words about the trailing precision. Joe said that we could use<span class="apple-converted-space"> </span></span><code><span style="font-size:10.0pt;font-family:"Menlo",serif;border:solid #EAEAEA 1.0pt;padding:0in;background:#F8F8F8">\("")</span></code><span class="apple-converted-space"><span style="font-size:10.0pt;font-family:"Helvetica",sans-serif"> </span></span><span style="font-size:10.0pt;font-family:"Helvetica",sans-serif">as
workaround, but if I recall correctly literals are banned from the interpolation itself, which will result in us doing something like this:<o:p></o:p></span></p>
<div style="mso-element:para-border-div;border:solid #CCCCCC 1.0pt;padding:3.0pt 6.0pt 3.0pt 6.0pt;background:#F8F8F8;margin-left:.5in;margin-right:0in">
<pre style="background:#F8F8F8;border:none;padding:0in;border-top-left-radius: 3px;border-top-right-radius: 3px;border-bottom-right-radius: 3px;border-bottom-left-radius: 3px;word-wrap: normal;font-variant-caps: normal;text-align:start;-webkit-text-stroke-width: 0px;overflow:auto;word-spacing:0px"><code><span style="font-family:"Menlo",serif;border:none windowtext 1.0pt;padding:0in;background:#F8F8F8">let end = ""<o:p></o:p></span></code></pre>
<pre style="background:#F8F8F8;border:none;padding:0in"><code><span style="font-family:"Menlo",serif;border:none windowtext 1.0pt;padding:0in;background:#F8F8F8"><o:p> </o:p></span></code></pre>
<pre style="background:#F8F8F8;border:none;padding:0in"><code><span style="font-family:"Menlo",serif;border:none windowtext 1.0pt;padding:0in;background:#F8F8F8">let myString = """<o:p></o:p></span></code></pre>
<pre style="background:#F8F8F8;border:none;padding:0in"><code><span style="font-family:"Menlo",serif;border:none windowtext 1.0pt;padding:0in;background:#F8F8F8"> <space><space>foo<space><space>\(end)<o:p></o:p></span></code></pre>
<pre style="background:#F8F8F8;border:none;padding:0in"><code><span style="font-family:"Menlo",serif;border:none windowtext 1.0pt;padding:0in;background:#F8F8F8"> """<o:p></o:p></span></code></pre>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:11.25pt;margin-right:0in;margin-bottom:11.25pt;margin-left:.5in;font-variant-caps: normal;text-align:start;-webkit-text-stroke-width: 0px;word-spacing:0px">
<span style="font-size:10.0pt;font-family:"Helvetica",sans-serif">This is a very dirty and tedious solution for that problem.<o:p></o:p></span></p>
</div>
</blockquote>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><<a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_apple_swift_blob_master_CHANGELOG.md-23swift-2D21&d=DwMFAg&c=DPL6_X_6JkXFx7AXWqB0tg&r=8mE7AItVCy7oLAwEVNP0_aca5QRASuJBqHQ_PFtDm-U&m=EBRF67tyQfqzwXnmP-XZ3jeiXtQcJ-HWYhol3nrfncs&s=oGf6XXh8EkR8GeYJFTzJcvjWe6dhObt4RsGlrbrml0o&e=">https://github.com/apple/swift/blob/master/CHANGELOG.md#swift-21</a>><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
</div>
<blockquote style="margin-left:30.0pt;margin-right:0in">
<div>
<p class="MsoNormal" style="margin-left:.5in"><span style="font-family:"Menlo",serif">* Expressions interpolated in strings may now contain string literals.</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><span style="font-family:"Menlo",serif"> For example, `My name is \(attributes["name"]!)` is now a valid expression.</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><span style="font-family:"Menlo",serif"> **(14050788)**</span><o:p></o:p></p>
</div>
</blockquote>
<div>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in">-- Ben<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
</div>
</div>
</body>
</html>