[swift-evolution] [Accepted] SE-0168: Multi-Line String Literals

Adrian Zubarev adrian.zubarev at devandartist.com
Thu Apr 20 12:02:35 CDT 2017


Exactly, thank you for the clarification. That is the correct decision IMO. :)

Here is the formatted version of the example from my last reply:

https://gist.github.com/DevAndArtist/345ce0920de62349c1079e18201aea94



-- 
Adrian Zubarev
Sent with Airmail

Am 20. April 2017 um 18:58:07, Joe Groff via swift-evolution (swift-evolution at swift.org) schrieb:


On Apr 19, 2017, at 3:27 PM, Xiaodi Wu <xiaodi.wu at gmail.com> wrote:

On Wed, Apr 19, 2017 at 5:24 PM, Joe Groff <jgroff at apple.com> wrote:

> On Apr 19, 2017, at 3:16 PM, Xiaodi Wu via swift-evolution <swift-evolution at swift.org> wrote:
>
> We had a very full debate about which way was superior during review; it was proposed to behave one way and the core team decided on the other. We have to let settled decisions be settled: that's the only way Swift Evolution will continue to work.

I'm asking the core team for clarification on the point of the closing newline.

Cool, thanks. Please do remind them, though, that not stripping the closing newline (which is what was originally proposed) *and* not having the option of using `\` to elide newlines (which is contrary to what was originally proposed) would mean that all multi-line strings would mandatorily end in a newline.

To clarify, the core team's decision is that one trailing newline should be elided before the closing delimiter. This maintains one consistent rule for both ends of the literal, so """\n and \n""" can be mentally understood as balanced delimiters. as Xiaodi noted, it would otherwise be impossible to write a literal without a trailing newline without scope-creeping the design with additional features.

-Joe
_______________________________________________
swift-evolution mailing list
swift-evolution at swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170420/5436d099/attachment.html>


More information about the swift-evolution mailing list