<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">As this review winds down it seems fair to say the response has been generally<div class="">favourable with some reservations about whether this should be applied to single</div><div class="">line strings as well. I’d include single line strings myself for consistency with multi-</div><div class="">line and with other languages myself but that isn’t the focus of this proposal.</div><div class=""><br class=""></div><div class="">There has also been some discussion about whether escaping the last newline should</div><div class="">be an error or ignored. For me this highlights that the final newline should be included</div><div class="">in the literal and could therefore be escaped when you want one without a newline at</div><div class="">the end which may or may not be the common use case as has been discussed before.</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><div style="margin: 0px; line-height: normal;" class=""><span style="color: #ba2da2" class="">let</span> text = <font color="#cf2f1b" class="">"""</font></div><div style="margin: 0px; line-height: normal;" class=""><font color="#cf2f1b" class="">&nbsp; &nbsp; Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod \</font></div><div style="margin: 0px; line-height: normal;" class=""><font color="#cf2f1b" class="">&nbsp; &nbsp; tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, \</font></div><div style="margin: 0px; line-height: normal;" class=""><font color="#cf2f1b" class="">&nbsp; &nbsp; quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\</font></div><div style="margin: 0px; line-height: normal;" class=""><font color="#cf2f1b" class="">&nbsp; &nbsp; """</font></div></div></div><div class=""><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span style="color: #ba2da2" class="">let</span> endsWithNewline = <font color="#cf2f1b" class="">"""</font></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><font color="#cf2f1b" class="">&nbsp; &nbsp; Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod</font></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><font color="#cf2f1b" class="">&nbsp; &nbsp; tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,</font></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><font color="#cf2f1b" class="">&nbsp; &nbsp; quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</font></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><font color="#cf2f1b" class="">&nbsp; &nbsp; "<span style="text-decoration: underline;" class="">"</span>"</font></div><div class=""><br class=""></div><div class="">While multi-line strings would loose their pleasing symmetry from SE-0168 where initial</div><div class="">and final newlines are stripped I'd argue in response that text is generally asymmetric</div><div class="">with files generally having no newline at the start and a newline at the end. I can see</div><div class="">the arguments for both decisions though and could live with either.</div><div class=""><br class=""></div><div class="">-John</div><div class="">&nbsp;<div class=""><div><blockquote type="cite" class=""><div class="">On 14 Jul 2017, at 18:17, Jordan Rose via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div 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; -webkit-text-stroke-width: 0px;" class=""><br class="Apple-interchange-newline"><br class=""><blockquote type="cite" class=""><div class="">On Jul 14, 2017, at 10:00, Alex Blewitt &lt;<a href="mailto:alblue@apple.com" class="">alblue@apple.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="" 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; -webkit-text-stroke-width: 0px;"><blockquote type="cite" class=""><div class="">On 13 Jul 2017, at 23:14, David Hart via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="" style="font-family: Helvetica; font-size: 18px; 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; -webkit-text-stroke-width: 0px;"><blockquote type="cite" class=""><div class=""><br class="Apple-interchange-newline">On 14 Jul 2017, at 00:21, Jordan Rose &lt;<a href="mailto:jordan_rose@apple.com" class="">jordan_rose@apple.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space;">[Proposal:<span class="Apple-converted-space">&nbsp;</span><a href="https://github.com/apple/swift-evolution/blob/master/proposals/0182-newline-escape-in-strings.md" class="">https://github.com/apple/swift-evolution/blob/master/proposals/0182-newline-escape-in-strings.md</a>]<div class=""><br class=""></div><div class="">This is a tiny, tiny point amidst the broader discussions others are having, but</div><div class=""><br class=""></div><div class=""><div class=""><blockquote type="cite" class=""><span class="Apple-tab-span" style="white-space: pre;">        </span>• All whitespace characters between&nbsp;\&nbsp;and the newline are disregarded.</blockquote><br class=""></div><div class="">Why? Why bother allowing whitespace characters between \ and the newline?</div></div></div></div></blockquote><div class=""><br class=""></div><div class="">The reasoning is to be consistent with trailing whitespace in the rest of the code: to leave that to a linter instead. Or to see it differently, even with whitespace between \ and the newline, the programmer’s intent is still clear. Why generate an error?</div></div></div></blockquote><br class=""></div><div class="" 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; -webkit-text-stroke-width: 0px;">For the same reason that code allows (e.g.) a comment at the end of the line; you wouldn't expect (newline continuation) (comment) to mean the same thing as if generic whitespace were added at the end. The convention in other languages is that \ immediately precedes the line feed to indicate a continuation, not that an orphan \ is valid on its own.</div><div class="" 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; -webkit-text-stroke-width: 0px;"><br class=""></div><div class="" 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; -webkit-text-stroke-width: 0px;">The reason that \(newline) is valid while \(otherchar)(newline) isn't is because \ immediately precedes another character that it is escaping, and it's possible that \(space) would have a meaning in the future, whereas \(newline) won't.</div></div></blockquote><br class=""></div><div 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; -webkit-text-stroke-width: 0px;" class="">I agree with Alex on this, although I would be happy to make it a warning rather than an error so that it doesn't block compilation.</div><div 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; -webkit-text-stroke-width: 0px;" class=""><br class=""></div><div 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; -webkit-text-stroke-width: 0px;" class="">The point about comments is also significant: we previously said that comments should generally be treated like whitespace (<a href="https://github.com/apple/swift-evolution/blob/master/proposals/0037-clarify-comments-and-operators.md" class="">SE-0037</a>). This is a little different because it's still inside the string literal, but it's probably worth explicitly stating "we're still inside a string literal; you can't just put comments after the backslash".</div><div 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; -webkit-text-stroke-width: 0px;" class=""><br class=""></div><div 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; -webkit-text-stroke-width: 0px;" class="">Jordan</div><br class="" 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; -webkit-text-stroke-width: 0px;"><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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">_______________________________________________</span><br 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; -webkit-text-stroke-width: 0px;" class=""><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; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">swift-evolution mailing list</span><br 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; -webkit-text-stroke-width: 0px;" class=""><a href="mailto:swift-evolution@swift.org" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">swift-evolution@swift.org</a><br 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; -webkit-text-stroke-width: 0px;" class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a></div></blockquote></div><br class=""></div></div></body></html>