<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=""><br class=""><div><blockquote type="cite" class=""><div class="">Am 15.04.2017 um 16:46 schrieb Ricardo Parada <<a href="mailto:rparada@mac.com" class="">rparada@mac.com</a>>:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><meta http-equiv="content-type" content="text/html; charset=utf-8" class=""><div dir="auto" class=""><div class=""><span class=""></span></div><div class=""><div class="">Reply inline. <!-- signature close --></div><div class=""><br class="">On Apr 15, 2017, at 8:48 AM, Thorsten Seitz via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:<br class=""><br class=""></div><blockquote type="cite" class=""><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">Am 15.04.2017 um 09:24 schrieb Adrian Zubarev via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>>:</div><br class="Apple-interchange-newline"><div class=""><div class="bloop_markdown" style="font-family: Helvetica, Arial; font-size: 13px; 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; background-color: rgb(254, 254, 254);"><p style="margin: 15px 0px; -webkit-margin-before: 0px;" class=""></p><p style="margin: 15px 0px;" class="">[…]</p></div></div></blockquote></div></div></div></blockquote></div></div></div></div></blockquote><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div dir="auto" class=""><div class=""><blockquote type="cite" class=""><div class=""><div class=""><div class=""><blockquote type="cite" class=""><div class=""><div class="bloop_markdown" style="font-family: Helvetica, Arial; font-size: 13px; 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; background-color: rgb(254, 254, 254);"><p style="margin: 15px 0px;" class="">Now it’s time to solve the puzzle in your example. The correct result should be as follows:</p><pre style="margin: 15px 0px; font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 1px solid rgb(204, 204, 204); overflow: auto; padding: 4px 8px; word-break: normal; word-wrap: normal;" class=""><code class="swift" style="font-family: Menlo, Consolas, 'Liberation Mono', Courier, monospace; font-size: 10pt; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: rgb(248, 248, 248); color: inherit; border: 0px; margin: 0px; padding: 0px; word-break: normal; word-wrap: normal; -webkit-margin-before: 0px;">(a + b) == """
This is line one
This is line twoThis is line three
This is line four
"""
// Or more precise
(a + b) == "This is line one\nThis is line twoThis is line three\nThis is line four“
</code></pre></div></div></blockquote><div class=""><br class=""></div><div class="">I disagree and think BJ Homer is right: the multiline variant contains *lines* which all end with a newline. That is a very simple mental model.<div class=""><br class=""></div><div class="">I do agree that the mixed modes (v1, v2, v3) should be banned.</div></div></div></div></div></blockquote><div class=""><br class=""></div><div class="">Hi Thorsten, I think v2 would allow you to pick an <i class="">alternate</i> <i class="">style</i> to define your multiline string literal. For example, take a look at the xml string literal defined in two different ways under the <b class="">Indentation Stripping</b> section in Brent's proposal here:</div><div class=""><br class=""></div><div class=""><a href="https://github.com/johnno1962a/swift-evolution/blob/master/proposals/0168-multi-line-string-literals.md" class="">https://github.com/johnno1962a/swift-evolution/blob/master/proposals/0168-multi-line-string-literals.md</a></div><div class=""><br class=""></div><div class=""><div class="">Here is another example:</div></div><div class=""><br class=""></div><div class=""><div class=""><div class=""><font face="Menlo" class=""><span class="" style="font-size: 11px;"><span class="Apple-tab-span" style="white-space: pre;">        </span>case .isExprSameType(let from, let to):</span></font></div></div><div class=""><div class=""><font face="Menlo" class=""><span class="" style="font-size: 11px;"><span class="Apple-tab-span" style="white-space: pre;">                </span>return """</span><font color="#d12f1b" class=""><span class="" style="font-size: 11px;">checking a value with optional type </span></font><font color="#1a04ff" class="" style="font-size: 11px;">\(</font><font color="#00ab00" class="" style="font-size: 11px;"><b class="">from</b></font><font color="#1a04ff" class=""><span class="" style="font-size: 11px;">)</span></font><span class="" style="font-size: 11px;"> </span></font><span class="" style="color: rgb(26, 4, 255); font-family: Menlo; font-size: 11px;">\</span></div><div class=""><span class="Apple-tab-span" style="font-family: Menlo; font-size: 11px; white-space: pre;">                        </span><span class="" style="font-family: Menlo; font-size: 11px;"> </span><font color="#d12f1b" class="" style="font-family: Menlo;"><span class="" style="font-size: 11px;">against dynamic type</span></font><span class="" style="font-family: Menlo; font-size: 11px;"> </span><font color="#1a04ff" class="" style="font-family: Menlo;"><span class="" style="font-size: 11px;">\(</span></font><font color="#00ab00" class="" style="font-family: Menlo; font-size: 11px;"><b class="">to</b></font><font color="#1a04ff" class="" style="font-family: Menlo;"><span class="" style="font-size: 11px;">) \</span></font></div><div class=""><font face="Menlo" class=""><span class="Apple-tab-span" style="font-size: 11px; white-space: pre;">                        </span><span class="" style="font-size: 11px;"> </span><font color="#d12f1b" class=""><span class="" style="font-size: 11px;">succeeds whenever the value is non-'nil'; </span></font></font><span class="" style="color: rgb(26, 4, 255); font-family: Menlo; font-size: 11px;">\</span></div><div class=""><span class="Apple-tab-span" style="font-family: Menlo; font-size: 11px; white-space: pre;">                        </span><span class="" style="font-family: Menlo; font-size: 11px;"> </span><font face="Menlo" class=""><font color="#d12f1b" class=""><span class="" style="font-size: 11px;">did you mean to use '!= nil'?</span></font></font><span class="" style="color: rgb(26, 4, 255); font-family: Menlo; font-size: 11px;">\</span></div><div class=""><span class="Apple-tab-span" style="font-family: Menlo; font-size: 11px; white-space: pre;">                        </span><span class="" style="font-family: Menlo; font-size: 11px;"> </span><span class="" style="font-family: Menlo; font-size: 11px;">"""</span></div></div></div><div class=""><br class=""></div></div></div></div></div></blockquote><div><br class=""></div><div>This only works because the lines have been indented by hand to match correctly which would not be the case with standard indentation used in a code editor which is a fixed multiple of spaces or tabs: the example had to add 2 spaces to the 2 tabs in this example to fix the indentation (requiring 8-space-tabs). In reality the example would look like follows (assuming 4-space-indentation but the problem is the same for other indentations):</div><div><br class=""></div><div><span style="font-size: 11px; font-family: Menlo;" class="">case .isExprSameType(let from, let to):</span><br class=""><font face="Menlo" class=""><span class="" style="font-size: 11px;"> return """</span><font color="#d12f1b" class=""><span class="" style="font-size: 11px;">checking a value with optional type </span></font><font color="#1a04ff" class="" style="font-size: 11px;">\(</font><font color="#00ab00" class="" style="font-size: 11px;"><b class="">from</b></font><font color="#1a04ff" class=""><span class="" style="font-size: 11px;">)</span></font><span class="" style="font-size: 11px;"> </span></font><span class="" style="color: rgb(26, 4, 255); font-family: Menlo; font-size: 11px;">\</span><br class=""><font color="#d12f1b" class="" style="font-family: Menlo;"><span class="" style="font-size: 11px;"> against dynamic type</span></font><span class="" style="font-family: Menlo; font-size: 11px;"> </span><font color="#1a04ff" class="" style="font-family: Menlo;"><span class="" style="font-size: 11px;">\(</span></font><font color="#00ab00" class="" style="font-family: Menlo; font-size: 11px;"><b class="">to</b></font><font color="#1a04ff" class="" style="font-family: Menlo;"><span class="" style="font-size: 11px;">) \</span></font><br class=""><font face="Menlo" class=""><font class=""><span class="" style="color: rgb(209, 47, 27); font-size: 11px;"> succeeds whenever the value is non-'nil'; </span></font></font><span class="" style="color: rgb(26, 4, 255); font-family: Menlo; font-size: 11px;">\</span><br class=""><font face="Menlo" class=""><font color="#d12f1b" class=""><span class="" style="font-size: 11px;"> did you mean to use '!= nil'?</span></font></font><span class="" style="color: rgb(26, 4, 255); font-family: Menlo; font-size: 11px;">\</span><br class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div dir="auto" class=""><div class=""><div class=""><div class=""><div class=""><span class="" style="font-family: Menlo; font-size: 11px;"><span style="color: rgb(209, 47, 27);" class=""> </span><span style="color: rgb(209, 47, 27);" class=""> </span>"""</span></div></div></div></div></div></div></div><div><br class=""></div><div>And the alignment has gone awry… That’s why I think this form is problematic. It saves just one line for the price of a broken alignment. </div><div>(Requiring the editor to have content sensitive indentation is a no go).</div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div dir="auto" class=""><div class=""><div class="">I personally do not find this style confusing at all. </div></div></div></div></div></blockquote><div><br class=""></div><div>The confusion arises over the leading newline: why does text directly following the opening triple quote have a newline while an empty line after the opening triple quote does not have a newline?</div><div><br class=""></div><div>Banning the mixed form eliminates that question which is a good thing IMHO.</div><div><br class=""></div><div>-Thorsten</div><div><div class=""><span style="font-family: Menlo; font-size: 11px;" class=""><br class=""></span></div></div><div><br class=""></div></div></body></html>