<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div></div><div>I regret that I didn't send my two proposals much earlier, but I was operating under the assumption that&nbsp;Swift 4 was not going to include changes such as this, so I thought I should wait and was surprised to stumble on this change. (I wonder if anyone else is in the same boat.)</div><div><span style="background-color: rgba(255, 255, 255, 0);"><br></span></div><div><span style="background-color: rgba(255, 255, 255, 0);">If people are not sure the existing commit is optimal, certainly it would make sense for it to be backed out sooner rather than later.</span></div><div><span style="background-color: rgba(255, 255, 255, 0);"><br></span></div><div><span style="background-color: rgba(255, 255, 255, 0);">Btw I don't mean for the close quote delimiter to be the only thing on the line, as one might expect by analogy with shell syntax.</span></div><div><br></div><div><span style="background-color: rgba(255, 255, 255, 0);">Dave</span></div><div><br>On May 25, 2017, at 11:24 PM, Robert Widmann &lt;<a href="mailto:rwidmann@apple.com">rwidmann@apple.com</a>&gt; wrote:<br><br></div><blockquote type="cite"><div><meta http-equiv="Content-Type" content="text/html charset=utf-8"><div class="">A quick question since we’ve already accepted this proposal and have an implementation in-tree: do you expect this breaking change to be accepted for Swift 4, or do you expect this change to break everybody once they’ve already migrated to the triple-quoted string form in a future release?</div><div class=""><br class=""></div><div class="">~Robert Widmann</div><br class=""><div><blockquote type="cite" class=""><div class="">On May 25, 2017, at 11:02 PM, Dave Yost 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="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><br class=""></div><div class=""><div class="">Beauty is a top-three goal of Swift, so a proposal that is not beautiful should be rethought until it is.</div><div class=""><br class=""></div><div class="">1.&nbsp;<span style="font-family: Menlo;" class="">"</span><span style="font-family: Menlo;" class="">"</span><span style="font-family: Menlo;" class="">"</span>&nbsp;is ugly.</div><div class=""><br class=""></div><div class="">2. Choosing syntax so as to pander to hacks in a few existing tools is the road to Ugly.</div><div class=""><br class=""></div><div class="">3. It’s inelegant syntax design for start and end delimiters to be identical, as for example ASCII quote marks are.[1]</div><div class=""><br class=""></div><div class="">4. Mirror image start and end delimiters are preferred, for example&nbsp;<font face="Menlo" class="">{</font>&nbsp;and <font face="Menlo" class="">}</font>.[1]</div><div class=""><br class=""></div><div class="">5. Escaping is ugly and preferably should not be necessary or even allowed.</div><div class=""><br class=""></div><div class="">Therefore, I propose, by example:</div><div class=""><br class=""></div><div class=""><font face="Menlo" class="">&nbsp; let foo =&nbsp;<br class=""></font><font face="Menlo" class="">&nbsp; &nbsp; /</font><span style="font-family: Menlo;" class="">"</span><font face="Menlo" class="">xx<br class=""></font><div class=""><font face="Menlo" class="">&nbsp; &nbsp; The indent of /"</font></div><div class=""><font face="Menlo" class="">&nbsp; &nbsp; &nbsp; &nbsp; dictates indentation&nbsp;</font><span style="font-family: Menlo;" class="">and must match&nbsp;</span></div><div class=""><font face="Menlo" class="">&nbsp; &nbsp; all indents through the&nbsp;</font><span style="font-family: Menlo;" class="">"</span><font face="Menlo" class="">/</font></div><div class=""><font face="Menlo" class="">&nbsp; &nbsp;&nbsp;</font><span style="font-family: Menlo;" class="">"</span><font face="Menlo" class="">/xx</font></div><div class=""><br class=""></div><div class="">where an optional arbitrary identifier, for example “xx”, can be appended to both the open and the close quote delimiters to avoid the need for escaping the close quote delimiter. The identifier has no other significance in the program.</div><div class=""><br class=""></div><div class="">I further propose that&nbsp;<font face="Menlo" class="">/'</font>&nbsp;and&nbsp;<span style="font-family: Menlo;" class="">'</span><font face="Menlo" class="">/</font>&nbsp;should be used to delimit a string that is interpreted literally, including newlines except for the newline on the last line of the string.</div><div class=""><br class=""></div><div class="">In future, consideration should be given to the idea of following the&nbsp;<font face="Menlo" class="">/</font><span style="font-family: Menlo;" class="">"</span>&nbsp;delimiter by a set of space-separated flags to determine treatment of newlines, the escape character (so it doesn’t have to be backslash), use of interpolated strings, the use of escape characters, etc.</div><div class=""><br class=""></div><div class="">Dave</div><div class=""><div id="signature" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><br class=""></div></div></div></div><div class="">(I intended all single and double quotes in this message to be ASCII, not curly. If any are curly, then blame the macOS Mail app.)</div><div class=""><br class=""></div><div class=""><div id="signature" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""></div></div></div><div class="">[1]. &nbsp;I think Swift should allow delimiting strings with “curly” quotes, and they should nest. See 3, 4, 5 above.</div></div></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=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""></div></blockquote></div><br class=""></div></blockquote></body></html>