<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 6 Apr 2017, at 20:35, Joe Groff via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><br class=""><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>• What is your evaluation of the proposal?<br class=""></div></div></div></div></blockquote><div><br class=""></div><div>I'm a -1 for several reasons, mostly subjective but still. First thing is that I'm generally not comfortable with encouraging the use of multi-line strings at all. These are things that usually should be templated or localised, and personally I don't see what's inconvenient about concatenating on those occasions where you can't (or just don't want to); I'm actually of the opinion that this is the kind of thing that <b class="">should</b> be awkward and annoying, to encourage developers to think about what they're doing.</div><div><br class=""></div><div>My second issue really is that, if the aim is simply to indent your multi-line string more nicely, then is this actually something that the language <b class="">has</b> to solve? I know we don't like to consider proposals purely from the perspective of what an IDE may, or may not, do, but this seems like a case where a good IDE could take:</div><div><br class=""></div></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div><div><font face="Monaco" class="">let foo = "This is my</font></div><div><font face="Monaco" class="">multi-line</font></div><div><font face="Monaco" class="">text"</font></div></div></blockquote><div class=""><br class=""></div>And display it visually to look like:<div class=""><br class=""></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><font face="Monaco" class="">let foo = "This is my</font></div><div class=""><font face="Monaco" class=""><span class="Apple-tab-span" style="white-space: pre;">        </span>multi-line</font></div><div class=""><font face="Monaco" class=""><span class="Apple-tab-span" style="white-space: pre;">        </span>text"</font></div></blockquote><div class=""><br class=""></div>This is basically what Xcode does for line-wrapped text right now. While it would mean people using more basic editors would still see the original, it's not really like that's a major problem.<div class=""><br class=""></div><div class="">Another alternative might be a compiler directive that is more explicit about what you want to do, for example:</div><div class=""><br class=""></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><font face="Monaco" class="">let foo = #trimleft("</font></div><div class=""><font face="Monaco" class=""><span class="Apple-tab-span" style="white-space:pre">        </span>This is my</font></div><div class=""><font face="Monaco" class=""><span class="Apple-tab-span" style="white-space:pre">                </span>multi-line</font></div><div class=""><font face="Monaco" class=""><span class="Apple-tab-span" style="white-space:pre">        </span>text</font></div><div class=""><font face="Monaco" class="">")</font></div></blockquote><div class=""><br class=""></div>Here the directive would look at the text as a whole and see that all lines are indented by at least one tab, and so strip one tab from each line. There's probably a better name for the directive, but hopefully you hopefully get the idea, as this is much more explicit about what you want to do.<div class=""><br class=""></div><div class="">Also, one thing that really stands out with the proposal is how unwise the example is; the fact that the assertion relies on leading whitespace being stripped from the multi-line HTML makes it clear why things like this may not be a good idea, as if the code is edited to produce indented HTML then the assertion will fail, even if the HTML is still correct. The continuation quotes example makes this more obvious as it actually include some of the whitespace, so which is correct?</div><div class=""><br class=""></div><div class="">I don't want to seem too negative, I just think that whitespace stripping multi-line strings are a weird thing to want in a language. If an easier multi-line syntax <b class="">has</b> to be added then my preference would be for the alternative continuation quotes personally, as it's more explicit about what is included, though I still say there's nothing wrong with just doing the concatenation and newline characters IMO, as it's fully supported today and not really that much more burdensome to do (and it being a bit more difficult may be a good thing, as I say).<br class=""><div class=""><br class=""><div class=""><div><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=""><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>• Is the problem being addressed significant enough to warrant a change to Swift?<br class=""></div></div></div></div></blockquote><div><br class=""></div><div>Not really. We can already do multi-line by either putting newlines inside quotes and leaving out indentation, or by concatenating lines terminated with the new-line character. IMO these two existing options are enough as it is.</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=""><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>• Does this proposal fit well with the feel and direction of Swift?<br class=""></div></div></div></div></blockquote><div><br class=""></div><div>I'm not sure; in terms of simplicity I think that adding new syntax for multi-line strings is an unnecessary added complexity and something else to learn, and doesn't enable anything we can't already do fairly easily.</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=""><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>• If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?<br class=""></div></div></div></div></blockquote><div><br class=""></div><div>All of the proposed syntaxes are present in various languages, I've used many of them, and I know from my own bad habits that 99% of the time I shouldn't have 😏</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=""><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>• How much effort did you put into your review? A glance, a quick reading, or an in-depth study?<br class=""></div></div></div></div></blockquote><div><br class=""></div><div>Followed the discussion and re-read the proposal.</div></div></div></div></div></body></html>