<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="">Not to mention that many IDEs (at least have options to) trim trailing whitespace automatically, so it has a fair to high likelihood of breaking unexpectedly and invisibly.<div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Apr 19, 2017, at 3:09 PM, Joe Groff 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=""><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 Apr 19, 2017, at 3:07 PM, Xiaodi Wu &lt;<a href="mailto:xiaodi.wu@gmail.com" class="">xiaodi.wu@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Hmm, I don't know that I agree. What's the harm of trailing spaces, and if a warning, how would I silence it given that \ is rejected as a way to suppress a literal newline?</div></div></blockquote><div class=""><br class=""></div><div class="">\("") comes to mind, if nothing else. Other common tools like Git already flag trailing whitespace by default, so even if Swift doesn't warn about it, you might still need to satisfy other tools in your pipeline.</div><div class=""><br class=""></div><div class="">-Joe</div><br class=""><blockquote type="cite" class=""><div class=""><div class=""><br class=""><div class="gmail_quote"><div class="">On Wed, Apr 19, 2017 at 17:02 Joe Groff via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:<br class=""></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" class=""><div class=""><blockquote type="cite" class=""><div class="">On Apr 19, 2017, at 2:43 PM, Adrian Zubarev &lt;<a href="mailto:adrian.zubarev@devandartist.com" target="_blank" class="">adrian.zubarev@devandartist.com</a>&gt; wrote:</div><br class="m_8602596960290602065Apple-interchange-newline"><div class=""><div class="m_8602596960290602065bloop_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;background-color:rgb(254,254,254)"><p style="margin:15px 0px" class="">First of all, thank you for accepting the proposal. However I still have one single concern left about the trailing whitespaces. Will the final implemented version raise a warning or produce an error when there are trailing whitespaces?</p><p style="margin:15px 0px" class="">The whole idea of a trailing<span class="m_8602596960290602065Apple-converted-space">&nbsp;</span><code 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:1px solid rgb(234,234,234);margin:0px 2px;padding:0px 5px;word-break:normal;word-wrap:normal" class="">\</code><span class="m_8602596960290602065Apple-converted-space">&nbsp;</span>was in first place to prevent new line injection but also for trailing whitespace character precision.</p><p style="margin:15px 0px" class="">The following example could have 1000 characters, but a different developer who reads the code wouldn’t even notice.</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="m_8602596960290602065swift" 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">"""
Foo&lt;space&gt;&lt;space&gt;…&lt;space&gt;
Bar
"""
</code></pre><p style="margin:15px 0px" class="">That’s what the trailing backslash was meant for. To prevent unwanted whitespaces, or if you really need them, to force you to be precise about them.</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="m_8602596960290602065swift" 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">"""
Foo&lt;space&gt;&lt;space&gt;&lt;space&gt;\n\
Bar
"""
</code></pre></div></div></blockquote></div></div><div style="word-wrap:break-word" class=""><div class="">That seems like a reasonable thing to warn about. That also reminds me, blank lines should be accepted within a literal even if they aren't "indented" with invisible whitespace.</div></div><div style="word-wrap:break-word" class=""><div class=""><br class=""></div><div class="">-Joe</div><br class=""></div>_______________________________________________<br class="">
swift-evolution mailing list<br class="">
<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a><br class="">
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class="">
</blockquote></div></div>
</div></blockquote></div><br class=""></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=""></div></body></html>