Sure, I can give an example. I'm not going to suggest that it'd win any awards, but:<br><br>By restricting multiline literals to begin and end on distinct lines, the core team has established an interesting property. Namely, "literals" are delimited horizontally while """literals""" are delimited vertically.<br><br>To enable hard wrapping, permit continuation of literals by apposition of consecutive literals. That is, "Hello, " "world!" would be equivalent to "Hello, world!". This single rule can be applied to either kind of string literal. That is:<br><br>let a =<br> "Hello, "<br> "world!"<br><br>let b =<br> """<br> Hello, <br> """ """<br> world!<br> """<br><br>a == b // true<br><br>It certainly permits elided newlines. It is the exact same rule applied to both types of literals. It preserves code indentation and does not require single-line string literals to support code stripping. I leave it to your judgement whether it works "equally well" and/or is "horrible."<br><div class="gmail_quote"><div dir="ltr">On Sun, Apr 23, 2017 at 04:13 Brent Royal-Gordon <<a href="mailto:brent@architechies.com">brent@architechies.com</a>> wrote:<br></div><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><blockquote type="cite"><div>On Apr 22, 2017, at 8:12 AM, Xiaodi Wu <<a href="mailto:xiaodi.wu@gmail.com" target="_blank">xiaodi.wu@gmail.com</a>> wrote:</div><br class="m_-1748841490727356249Apple-interchange-newline"><div><div dir="ltr">On Sat, Apr 22, 2017 at 3:38 AM, Brent Royal-Gordon <span dir="ltr"><<a href="mailto:brent@architechies.com" target="_blank">brent@architechies.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><span><div><blockquote type="cite"><div>On Apr 21, 2017, at 11:48 AM, Xiaodi Wu via swift-evolution <<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>> wrote:</div><br class="m_-1748841490727356249m_-9186835439891025487Apple-interchange-newline"><div><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;float:none;display:inline!important">This goes to my question to David Hart. Isn't this an argument for a feature to allow breaking a single-line string literal across multiple lines? What makes this a use case for some feature for _multiline_ string literals in particular?</span></div></blockquote><br></div></span><div>Well, if you're breaking a string across several lines, you will want indentation stripping too. Are you suggesting we should also bring that feature to single-line string literals with escaped newlines?</div></div></blockquote><div><br></div><div>No, I am suggesting that whatever design is used for escaped newlines, if at all possible it should be equally apt for "strings" and """strings""" such that it will not require indentation stripping.</div></div></div></div>
</div></blockquote><br></div></div><div style="word-wrap:break-word"><div>Could you share an example of such a design? It doesn't have to be something you'd be happy to have in the language; it just needs to fit the following criteria:</div><div><br></div><div>* Permits non-significant hard-wrapping in a string literal.</div><div><br></div><div>* Works equally well with single and triple string literals.</div><div><br></div><div>* Preserves code indentation, but does not require single string literals to do indentation stripping.</div><div><br></div><div>* Is not horribly inconvenient.</div></div><div style="word-wrap:break-word"><br><div>
<span class="m_-1748841490727356249Apple-style-span" style="border-collapse:separate;color:rgb(0,0,0);font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div><div style="font-size:12px">-- </div><div style="font-size:12px">Brent Royal-Gordon</div><div style="font-size:12px">Architechies</div></div></span>
</div>
<br></div></blockquote></div>