<html><head><style>
body {
        font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
        padding:1em;
        margin:auto;
        background:#fefefe;
}

h1, h2, h3, h4, h5, h6 {
        font-weight: bold;
}

h1 {
        color: #000000;
        font-size: 28pt;
}

h2 {
        border-bottom: 1px solid #CCCCCC;
        color: #000000;
        font-size: 24px;
}

h3 {
        font-size: 18px;
}

h4 {
        font-size: 16px;
}

h5 {
        font-size: 14px;
}

h6 {
        color: #777777;
        background-color: inherit;
        font-size: 14px;
}

hr {
        height: 0.2em;
        border: 0;
        color: #CCCCCC;
        background-color: #CCCCCC;
    display: inherit;
}

p, blockquote, ul, ol, dl, li, table, pre {
        margin: 15px 0;
}

a, a:visited {
        color: #4183C4;
        background-color: inherit;
        text-decoration: none;
}

#message {
        border-radius: 6px;
        border: 1px solid #ccc;
        display:block;
        width:100%;
        height:60px;
        margin:6px 0px;
}

button, #ws {
        font-size: 12 pt;
        padding: 4px 6px;
        border-radius: 5px;
        border: 1px solid #bbb;
        background-color: #eee;
}

code, pre, #ws, #message {
        font-family: Monaco;
        font-size: 10pt;
        border-radius: 3px;
        background-color: #F8F8F8;
        color: inherit;
}

code {
        border: 1px solid #EAEAEA;
        margin: 0 2px;
        padding: 0 5px;
}

pre {
        border: 1px solid #CCCCCC;
        overflow: auto;
        padding: 4px 8px;
}

pre > code {
        border: 0;
        margin: 0;
        padding: 0;
}

#ws { background-color: #f8f8f8; }


.bloop_markdown table {
border-collapse: collapse;  
font-family: Helvetica, arial, freesans, clean, sans-serif;  
color: rgb(51, 51, 51);  
font-size: 15px; line-height: 25px;
padding: 0; }

.bloop_markdown table tr {
border-top: 1px solid #cccccc;
background-color: white;
margin: 0;
padding: 0; }
     
.bloop_markdown table tr:nth-child(2n) {
background-color: #f8f8f8; }

.bloop_markdown table tr th {
font-weight: bold;
border: 1px solid #cccccc;
margin: 0;
padding: 6px 13px; }

.bloop_markdown table tr td {
border: 1px solid #cccccc;
margin: 0;
padding: 6px 13px; }

.bloop_markdown table tr th :first-child, table tr td :first-child {
margin-top: 0; }

.bloop_markdown table tr th :last-child, table tr td :last-child {
margin-bottom: 0; }

.bloop_markdown blockquote{
  border-left: 4px solid #dddddd;
  padding: 0 15px;
  color: #777777; }
  blockquote > :first-child {
    margin-top: 0; }
  blockquote > :last-child {
    margin-bottom: 0; }

code, pre, #ws, #message {
    word-break: normal;
    word-wrap: normal;
}

hr {
    display: inherit;
}

.bloop_markdown :first-child {
    -webkit-margin-before: 0;
}

code, pre, #ws, #message {
    font-family: Menlo, Consolas, Liberation Mono, Courier, monospace;
}


.send { color:#77bb77; }
.server { color:#7799bb; }
.error { color:#AA0000; }</style></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class="bloop_markdown"><p>The main issue with that design is, even if it’s only bikeshedding here, that it creates ambiguity.</p>

<pre><code class="swift">let a =
"Hello, "
"world!"
</code></pre>

<p>To me that reads like the string constant <code>a</code> would contain <code>"Hello, "</code> and the literal <code>"world!"</code> sits somewhere in the middle of your code and is unused. Nothing signals to the developer that both string will be concatenated during compile time.</p>

<p></p></div><div class="bloop_original_html"><style>body{font-family:Helvetica,Arial;font-size:13px}</style><div id="bloop_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="bloop_sign_1492955689138132992" class="bloop_sign"><div style="font-family:helvetica,arial;font-size:13px">--&nbsp;<br>Adrian Zubarev<br>Sent with Airmail</div></div> <br><p class="airmail_on">Am 23. April 2017 um 11:41:38, Xiaodi Wu via swift-evolution (<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>) schrieb:</p> <blockquote type="cite" class="clean_bq"><span><div><div></div><div>


<title></title>


Sure, I can give an example. I'm not going to suggest that it'd win
any awards, but:<br>
<br>
By restricting multiline literals to begin and end on distinct
lines, the core team has established an interesting property.
Namely, "literals" are delimited horizontally while """literals"""
are delimited vertically.<br>
<br>
To enable hard wrapping, permit continuation of literals by
apposition of consecutive literals. That is, "Hello, " "world!"
would be equivalent to "Hello, world!". This single rule can be
applied to either kind of string literal. That is:<br>
<br>
let a =<br>
"Hello, "<br>
"world!"<br>
<br>
let b =<br>
"""<br>
Hello,<br>
""" """<br>
world!<br>
"""<br>
<br>
a == b // true<br>
<br>
It certainly permits elided newlines. It is the exact same rule
applied to both types of literals. It preserves code indentation
and does not require single-line string literals to support code
stripping. I leave it to your judgement whether it works "equally
well" and/or is "horrible."<br>
<div class="gmail_quote">
<div dir="ltr">On Sun, Apr 23, 2017 at 04:13 Brent Royal-Gordon
&lt;<a href="mailto:brent@architechies.com">brent@architechies.com</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>
<blockquote type="cite">
<div>On Apr 22, 2017, at 8:12 AM, Xiaodi Wu &lt;<a href="mailto:xiaodi.wu@gmail.com" target="_blank">xiaodi.wu@gmail.com</a>&gt; wrote:</div>
<br class="m_-1748841490727356249Apple-interchange-newline">
<div>
<div dir="ltr">On Sat, Apr 22, 2017 at 3:38 AM, Brent Royal-Gordon
<span dir="ltr">&lt;<a href="mailto:brent@architechies.com" target="_blank">brent@architechies.com</a>&gt;</span> wrote:<br>
<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 style="word-wrap:break-word">
<div>
<blockquote type="cite">
<div><span>On Apr 21, 2017, at 11:48 AM, Xiaodi Wu via
swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt;
wrote:</span></div>
<span><br class="m_-1748841490727356249m_-9186835439891025487Apple-interchange-newline">
</span>
<div><span><span style="font-family:Helvetica;font-size:12px;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;float:none;display:inline!important">
This goes to my question to David Hart. Isn't this an argument for
a feature to allow breaking a single-line string literal across
multiple lines?&nbsp;What makes this a use case for some feature
for _multiline_ string literals in particular?</span></span></div>
</blockquote>
<br></div>
<div>Well, if you're breaking a string across several lines, you
will want indentation stripping too. Are you suggesting we should
also bring that feature to single-line string literals with escaped
newlines?</div>
</div>
</blockquote>
<div><br></div>
<div>No, I am suggesting that whatever design is used for escaped
newlines, if at all possible it should be equally apt for "strings"
and """strings""" such that it will not require indentation
stripping.</div>
</div>
</div>
</div>
</div>
</blockquote>
<br></div>
</div>
<div style="word-wrap:break-word">
<div>Could you share an example of such a design? It doesn't have
to be something you'd be happy to have in the language; it just
needs to fit the following criteria:</div>
<div><br></div>
<div>* Permits non-significant hard-wrapping in a string
literal.</div>
<div><br></div>
<div>* Works equally well with single and triple string
literals.</div>
<div><br></div>
<div>* Preserves code indentation, but does not require single
string literals to do indentation stripping.</div>
<div><br></div>
<div>* Is not horribly inconvenient.</div>
</div>
<div style="word-wrap:break-word"><br>
<div>
<div>
<div style="font-size:12px"><span class="m_-1748841490727356249Apple-style-span" style="border-collapse:separate;color:rgb(0,0,0);font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
--&nbsp;</span></div>
<div style="font-size:12px"><span class="m_-1748841490727356249Apple-style-span" style="border-collapse:separate;color:rgb(0,0,0);font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
Brent Royal-Gordon</span></div>
<div style="font-size:12px"><span class="m_-1748841490727356249Apple-style-span" style="border-collapse:separate;color:rgb(0,0,0);font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
Architechies</span></div>
</div>
</div>
<br></div>
</blockquote>
</div>


_______________________________________________<br>swift-evolution mailing list<br>swift-evolution@swift.org<br>https://lists.swift.org/mailman/listinfo/swift-evolution<br></div></div></span></blockquote></div><div class="bloop_markdown"><p></p></div></body></html>