<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="">On May 5, 2016, at 8:27 PM, Tyler Cloutier via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</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=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On May 5, 2016, at 5:08 PM, John Holdsworth via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</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=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On 5 May 2016, at 14:17, David Hart <<a href="mailto:david@hartbit.com" class="">david@hartbit.com</a>> wrote:</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=""><div class=""><br class=""></div><div class=""><blockquote type="cite" class=""><div class="">On 05 May 2016, at 12:30, Michael Peternell via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><span style="font-family: Helvetica; font-size: 14px; 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-stroke-width: 0px; float: none; display: inline !important;" class="">it's not a secret that I'm not a big fan of the proposal. The third draft doesn't change this and it's unlikely that any future draft will, because for me, the problem are the continuation quotes, and for Brent it seems like they are a must-have-feature (correct me if I'm wrong.)</span></div></blockquote><br class=""></div><div class="">I agree with all you said. I’m fairly sure I would never vote for Brent’s proposal simply because of the existence of continuation quotes, no matter the amount of reasoning behind it. They are simply too unwieldy, cumbersome and unfriendly to modification.</div><div class=""><br class=""></div><div class="">I could see either your proposal, or your proposal without the HERE_DOCs but using Tyler’s/Scala’s <span style="font-family: monospace; white-space: pre;" class="">.stripMargin</span><span style="white-space: pre;" class="">. Do you think you could start a formal proposal?</span></div></div></div></blockquote></div><div class=""><br class=""></div>Adapting the original proposal if you’re not a fan of continuation quotes..<div class=""><br class=""><div class=""><div class="">It’s possible to have a multiline “””python””” multi-line string but tidily indented.</div><div class="">As suggested earlier in this thread the lexer can strip the margin on the basis of</div><div class="">the whitespace before the closing quote as per Perl6 (This could be a modifier “I”</div><div class="">but might as well be the default TBH.) Would this be the best of both worlds?</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(61, 29, 129);" class="">assert</span><span style="font-variant-ligatures: no-common-ligatures;" class="">( xml == i""</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(209, 47, 27);" class="">"</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> <?xml version="1.0"?></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> <catalog></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> <book id="bk101" empty=""></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> <author></span><span style="font-variant-ligatures: no-common-ligatures;" class="">\</span><span style="font-variant-ligatures: no-common-ligatures;" class="">(</span><span style="font-variant-ligatures: no-common-ligatures;" class="">author</span><span style="font-variant-ligatures: no-common-ligatures;" class="">)</author></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> <title>XML Developer's Guide</title></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> <genre>Computer</genre></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> <price>44.95</price></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> <publish_date>2000-10-01</publish_date></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> <description>An in-depth look at creating applications with XML.</description></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> </book></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> </catalog></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> "</span><span style="font-variant-ligatures: no-common-ligatures;" class="">"” )</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);" class=""><br class=""></div></div><div style="margin: 0px; line-height: normal; min-height: 13px;" class="">Other modifiers can also be applied such as “no-escapes"</div><div style="margin: 0px; line-height: normal; min-height: 13px;" class=""><br class=""></div><div style="margin: 0px; line-height: normal; min-height: 13px;" class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(61, 29, 129);" class="">assert</span><span style="font-variant-ligatures: no-common-ligatures;" class="">( xml != ei""</span><span style="font-variant-ligatures: no-common-ligatures;" class="">"<?xml version="1.0"?></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> <catalog></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> <book id="bk101" empty=""></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> <author>\(author)</author></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> <title>XML Developer's Guide</title></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> <genre>Computer</genre></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> <price>44.95</price></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> <publish_date>2000-10-01</publish_date></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> <description>An in-depth look at creating applications with XML.</description></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> </book></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> </catalog></span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""> "</span><span style="font-variant-ligatures: no-common-ligatures;" class="">"" )</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">I’d hope this would satisfy any need for <<HERE/<<‘HERE’ style constructs.</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><br class=""></span></div></div><div style="margin: 0px; line-height: normal; min-height: 13px;" class="">Or you could support both continuation and indented python style:</div><div style="margin: 0px; line-height: normal; min-height: 13px;" class=""><a href="http://johnholdsworth.com/swift-LOCAL-2016-05-05-a-osx.tar.gz" class="">http://johnholdsworth.com/swift-LOCAL-2016-05-05-a-osx.tar.gz</a></div><div style="margin: 0px; line-height: normal; min-height: 13px;" class=""><br class=""></div><div style="margin: 0px; line-height: normal; min-height: 13px;" class="">John</div><div class=""><br class=""></div><blockquote type="cite" class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"></div></blockquote></div></div></div>_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""></div></blockquote></div><br class=""><div class="">I’m of the opinion that either of these are reasonable solutions, and both offer different tradeoffs. I’m probably partial to the continuation quotes, because I don’t want to be guessing about what is going to end up being in my string and what won’t. </div><div class=""><br class=""></div><div class=""><blockquote type="cite" class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class=""><div class=""><div class="" style="margin: 0px; line-height: normal; min-height: 13px;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);"><span class="" style="font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(61, 29, 129);">assert</span><span class="" style="font-variant-ligatures: no-common-ligatures;">( xml != ei""</span><span class="" style="font-variant-ligatures: no-common-ligatures;">"<?xml version="1.0"?></span></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);"><span class="" style="font-variant-ligatures: no-common-ligatures;"> <catalog></span></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);"><span class="" style="font-variant-ligatures: no-common-ligatures;"> <book id="bk101" empty=""></span></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);"><span class="" style="font-variant-ligatures: no-common-ligatures;"> <author>\(author)</author></span></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);"><span class="" style="font-variant-ligatures: no-common-ligatures;"> <title>XML Developer's Guide</title></span></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);"><span class="" style="font-variant-ligatures: no-common-ligatures;"> <genre>Computer</genre></span></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);"><span class="" style="font-variant-ligatures: no-common-ligatures;"> <price>44.95</price></span></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);"><span class="" style="font-variant-ligatures: no-common-ligatures;"> <publish_date>2000-10-01</publish_date></span></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);"><span class="" style="font-variant-ligatures: no-common-ligatures;"> <description>An in-depth look at creating applications with XML.</description></span></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);"><span class="" style="font-variant-ligatures: no-common-ligatures;"> </book></span></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);"><span class="" style="font-variant-ligatures: no-common-ligatures;"> </catalog></span></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);"><span class="" style="font-variant-ligatures: no-common-ligatures;"> "</span><span class="" style="font-variant-ligatures: no-common-ligatures;">"” )</span></div></div></div></div></div></blockquote><br class=""></div><div class="">For example, is there a new line after </catalog>?</div><div class="">How would the indenting work if it were immediately followed by triple quotes: </catalog>”””</div><div class="">I would really like the first line to be lined up with the rest of the xml. Is that going to introduce a newline into the top of the string?</div><div class=""><br class=""></div><div class="">Could we just enforce that no characters on the lines of the triple quotes would be included in the string, very much like the heredoc syntax?</div><div class=""><br class=""></div><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class=""><div class=""><div class="" style="margin: 0px; line-height: normal; min-height: 13px;"><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span class="" style="color: rgb(209, 47, 27); font-variant-ligatures: no-common-ligatures;"> </span><span class="" style="color: rgb(61, 29, 129); font-variant-ligatures: no-common-ligatures;">assert</span><span class="" style="color: rgb(209, 47, 27); font-variant-ligatures: no-common-ligatures;">( </span><span class="" style="font-variant-ligatures: no-common-ligatures;">xml != ei</span><span class="" style="color: rgb(209, 47, 27); font-variant-ligatures: no-common-ligatures;">"”</span><span class="" style="font-variant-ligatures: no-common-ligatures;"><font color="#d12f1b" class="">” </font>The text I’m typing here would cause a compiler error.</span></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);"><span class="" style="font-variant-ligatures: no-common-ligatures;"> <?xml version="1.0"?></span></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);"><span class="" style="font-variant-ligatures: no-common-ligatures;"> <catalog></span></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);"><span class="" style="font-variant-ligatures: no-common-ligatures;"> <book id="bk101" empty=""></span></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);"><span class="" style="font-variant-ligatures: no-common-ligatures;"> <author>\(author)</author></span></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);"><span class="" style="font-variant-ligatures: no-common-ligatures;"> <title>XML Developer's Guide</title></span></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);"><span class="" style="font-variant-ligatures: no-common-ligatures;"> <genre>Computer</genre></span></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);"><span class="" style="font-variant-ligatures: no-common-ligatures;"> <price>44.95</price></span></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);"><span class="" style="font-variant-ligatures: no-common-ligatures;"> <publish_date>2000-10-01</publish_date></span></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);"><span class="" style="font-variant-ligatures: no-common-ligatures;"> <description>An in-depth look at creating applications with XML.</description></span></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);"><span class="" style="font-variant-ligatures: no-common-ligatures;"> </book></span></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);"><span class="" style="font-variant-ligatures: no-common-ligatures;"> </catalog></span></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;">same here<font color="#d12f1b" class=""> "</font></span><span class="" style="color: rgb(209, 47, 27); font-variant-ligatures: no-common-ligatures;">"” )</span></div></div></div></div></div></div><div class=""><br class=""></div><div class="">Then it’s very clear what the whitespace stripping will do. But what about mixed tab vs whitespace? What is the behavior in that case?</div></div></div></blockquote><div><br class=""></div><div><br class=""></div><div>I’m jumping into this thread late and have only followed bits of it so I apologize if I’m repeating anything.</div><div><br class=""></div><div>I really like the idea of having leading space stripped automatically without requiring the continuation quotes. I have done my share of leading space stripping in the past when working with heredocs. It’s not that big a deal but it would be better to have the language take care of it for us.</div><div><br class=""></div><div>I like the idea of banning any characters on the same line as the triple quotes (not just omitting them but actually making it a syntax error to include them).</div><div><br class=""></div><div>As far as mixed whitespace, I think the only sane thing to do would be to only allow leading tabs *or* spaces. Mixing tabs and spaces in the leading whitespace would be a syntax error. All lines in the string would need to use tabs or all lines use spaces, you could not have one line with tabs and another with spaces. This would keep the compiler out of the business of making any assumptions or guesses, would not be a problem often, and would be very easy to fix if it ever happens accidentally.</div><div><br class=""></div><div>-Matthew</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 class=""><br class=""></div><div class="">Tyler</div><div class=""><br class=""></div></div>_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></blockquote></div><br class=""></body></html>