[swift-evolution] [Review] SE-0168: Multi-Line String Literals
svabox at gmail.com
Thu Apr 13 12:51:15 CDT 2017
On 13.04.2017 15:41, Brent Royal-Gordon via swift-evolution wrote:
>> On Apr 13, 2017, at 5:35 AM, Ricardo Parada via swift-evolution
>> <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> wrote:
>> Take a look at Brent's revised proposal.I personally thin it is perfect. Take a look:
> Well, um, looks like we got scooped. (I was playing with some non-essential wording
> and trying to test all the examples before I pointed the list at the new version.)
FWIW Although I still believe that allowing text on the same line with opening or
closing """ (except for the single-line case) is over-complicating of the model and
adding unnecessary point of confusion, especially for the reader of code("will new
line be inserted here?!well.. for this special case I have to check docs"..), I can
give +1 for this updated proposal as it provides correct(from my point of view)
behavior for "normal" multi-line string like
-> "line 1\nline 2\n"
> Since requiring a leading backslash went over like a lead balloon, we've revised the
> proposal one more time. The leading newline is now optional: If indentation stripping
> is enabled, you can either start typing content on the same line as the delimiter, or
> you can start on the next line. I resisted this solution for a while because it seems
> ad-hoc, but ultimately it's the design that preserves the most formatting flexibility
> for the user, so I think it's the right way to go.
> Other than that, there are no changes to the design in this revision, though I've
> rephrased a few things and added a section about why we strip a leading newline but
> not a trailing one.
> John has also built a new version of the toolchain which matches this behavior.
> Download it here: http://johnholdsworth.com/swift-LOCAL-2017-04-13-a-osx.tar.gz
> Thanks for your feedback!
> Brent Royal-Gordon
> swift-evolution mailing list
> swift-evolution at swift.org
More information about the swift-evolution