<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>I don't think the intent of multi-line string literals is to replace files or templating libraries. I use those all the time and are superior.&nbsp;</div><div id="AppleMailSignature"><br></div><div id="AppleMailSignature"><span style="background-color: rgba(255, 255, 255, 0);">I think it would be handy and make it more pleasant to use for simple cases.&nbsp;</span></div><div id="AppleMailSignature"><span style="background-color: rgba(255, 255, 255, 0);"><br></span></div><div id="AppleMailSignature">Who has not run into a little multi-line literal in your code where you concatenate the pieces using +, add \n at the end of each line and have to escape quotes?<br><br></div><div><br>On May 12, 2016, at 12:36 PM, Leonardo Pessoa &lt;<a href="mailto:me@lmpessoa.com">me@lmpessoa.com</a>&gt; wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr"><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">I'm not in favour of multiline strings. I believe such strings should be stored in plain files and loaded as needed. It makes both the code and the string cleaner to read and maintain. I've had experiences with many languages that offer that resource and I could see what your code can become in terms of maintainability when you have such feature on the language.</div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">-1 from me.</div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr">- Leonardo</div></div></div>
<br><div class="gmail_quote">On 12 May 2016 at 01:05, Eduardo Mourey Lopez Ne 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><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>Something like this might work</div><div><br></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,132,0)"><span>//string ends on the first line that doesnt start with a "</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="color:rgb(0,0,0)">foo( </span><font color="#b51a00"><span>@</span><span>"&lt;?xml version="</span><span>1.0</span><span>"?&gt;</span></font></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span><font color="#b51a00">&nbsp;&nbsp; &nbsp; &nbsp; "&lt;catalog&gt;</font></span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><font color="#b51a00"><span>&nbsp;&nbsp; &nbsp; &nbsp; </span><span>" &nbsp; &lt;book id="</span><span>bk101</span><span>" empty="</span><span>"&gt;</span></font></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span><font color="#b51a00">&nbsp;&nbsp; &nbsp; &nbsp; " &nbsp; &nbsp; &nbsp; &lt;author&gt;\(author)&lt;/author&gt;</font></span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span><font color="#b51a00">&nbsp;&nbsp; &nbsp; &nbsp; " &nbsp; &nbsp; &nbsp; &lt;title&gt;XML Developer's Guide&lt;/title&gt;</font></span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span><font color="#b51a00">&nbsp;&nbsp; &nbsp; &nbsp; " &nbsp; &nbsp; &nbsp; &lt;genre&gt;Computer&lt;/genre&gt;</font></span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span><font color="#b51a00">&nbsp;&nbsp; &nbsp; &nbsp; " &nbsp; &nbsp; &nbsp; &lt;price&gt;44.95&lt;/price&gt;</font></span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span><font color="#b51a00">&nbsp;&nbsp; &nbsp; &nbsp; " &nbsp; &nbsp; &nbsp; &lt;publish_date&gt;2000-10-01&lt;/publish_date&gt;</font></span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span><font color="#b51a00">&nbsp;&nbsp; &nbsp; &nbsp; " &nbsp; &nbsp; &nbsp; &lt;description&gt;An in-depth look at creating applications with&nbsp; &nbsp; XML.&lt;/description&gt;</font></span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span><font color="#b51a00">&nbsp;&nbsp; &nbsp; &nbsp; " &nbsp; &lt;/book&gt;</font></span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span><font color="#b51a00">&nbsp;&nbsp; &nbsp; &nbsp; "&lt;/catalog&gt;\n</font></span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span>&nbsp; &nbsp; )</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span><br></span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo"><span><div style="margin:0px;line-height:normal;color:rgb(0,132,0)"><span>//additionally using a +" could be used to indicate a line break</span></div><div style="margin:0px;line-height:normal"><span><div style="margin:0px;line-height:normal"><span style="color:rgb(0,0,0)">foo( </span><font color="#b51a00"><span>@</span><span>"&lt;?xml version="</span><span>1.0</span><span>"?&gt;</span></font></div><div style="margin:0px;line-height:normal"><span><font color="#b51a00">&nbsp; &nbsp; &nbsp; +"&lt;catalog&gt;</font></span></div><div style="margin:0px;line-height:normal"><font color="#b51a00"><span>&nbsp; &nbsp; &nbsp; +</span><span>"&nbsp;&nbsp;&nbsp;&lt;book id="</span><span>bk101</span><span>" empty="</span><span>"&gt;</span></font></div><div style="margin:0px;line-height:normal"><span><font color="#b51a00">&nbsp; &nbsp; &nbsp; +"&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&lt;author&gt;\(author)&lt;/author&gt;</font></span></div><div style="margin:0px;line-height:normal"><span><font color="#b51a00">&nbsp; &nbsp; &nbsp; +"&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&lt;title&gt;XML Developer's Guide&lt;/title&gt;</font></span></div><div style="margin:0px;line-height:normal"><span><font color="#b51a00">&nbsp; &nbsp; &nbsp; +"&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&lt;genre&gt;Computer&lt;/genre&gt;</font></span></div><div style="margin:0px;line-height:normal"><span><font color="#b51a00">&nbsp; &nbsp; &nbsp; +"&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&lt;price&gt;44.95&lt;/price&gt;</font></span></div><div style="margin:0px;line-height:normal"><span><font color="#b51a00">&nbsp; &nbsp; &nbsp; +"&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&lt;publish_date&gt;2000-10-01&lt;/publish_date&gt;</font></span></div><div style="margin:0px;line-height:normal"><span><font color="#b51a00">&nbsp; &nbsp; &nbsp; +"&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&lt;description&gt;An in-depth look at creating applications with&nbsp; &nbsp;&nbsp;XML.&lt;/description&gt;</font></span></div><div style="margin:0px;line-height:normal"><span><font color="#b51a00">&nbsp; &nbsp; &nbsp; +"&nbsp;&nbsp;&nbsp;&lt;/book&gt;</font></span></div><div style="margin:0px;line-height:normal"><span><font color="#b51a00">&nbsp; &nbsp; &nbsp; +"&lt;/catalog&gt;\n</font></span></div><div style="color:rgb(0,0,0);margin:0px;line-height:normal"><span>&nbsp; &nbsp; )</span></div><div style="color:rgb(0,0,0);margin:0px;line-height:normal"><span><br></span></div></span></div></span></div><div><div class="h5"><div><blockquote type="cite"><div>On May 11, 2016, at 9:48 PM, Ricardo Parada via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt; wrote:</div><br><div><div><br><br>On May 11, 2016, at 2:34 PM, Vladimir.S &lt;<a href="mailto:svabox@gmail.com" target="_blank">svabox@gmail.com</a>&gt; wrote:<br><br><blockquote type="cite"><blockquote type="cite">For example:<br><br><br>letsourceCode =@“NSString *firstName = @“John”;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"NSString *lastName = @“Doe”;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;“NSString *fullName = [NSString stringWithFormat: @“%@<br>%@“, firstName, lastName];"@<br><br>The one that would be a bit of a problem is the closing delimiter,<br></blockquote><br>Yes.. this is why I asked about `"@` - closing delimiter<br>so.. what is the solution in your case ?<br></blockquote><br>Hi Vladimir,<br><br>I don't really have a solution. Perhaps escaping the closing delimiter like this \"@<br><br>It is not pretty but I can't think of anything else. I imagine the other alternatives, i.e. &nbsp;&nbsp;the triple quote `"""` and the quote plus underscore `"_ ` &nbsp;have the same problem. <br><br>If we make the continuation quote required then we don't need a closing delimiter. That would solve the problem. But I've seen several people say they don't like the continuation quote because they want to be able to paste text and not have to worry much about formatting it afterwards. <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" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br></div></div></blockquote></div><br></div></div></div><br>_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org">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>
<br></blockquote></div><br></div>
</div></blockquote></body></html>