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

Xiaodi Wu xiaodi.wu at gmail.com
Thu Apr 6 18:53:49 CDT 2017


>
>
> • What is your evaluation of the proposal?
>

In terms of the overarching theme, I think it is delightful.

But I am very disappointed that this proposal did not first circulate as a
draft in the past few months prior to being sent out for review. I
understand that it is an abbreviated timeline for evolution, but there are
key elements missing from this proposal that need clarification before it
can properly be reviewed. Greg Parker covers some important questions, but
there are others too:

1. The proposal states that "any initial linefeed" is stripped:
- Is that one initial linefeed, or arbitrarily many initial linefeeds?
- Is that only LF, or also CR and/or CRLF?
- How about trailing LF, CR, and/or CRLF?
    - If trailing LF/CR/CRLF is stripped, is it only one or arbitrarily
many?
    - If arbitrarily many, would one have to escape trailing LF to avoid
such stripping (as in, `\n`)?
    - If none are stripped, then how can one choose to specify the correct
indentation without the string obligatorily ending with an LF/CR/CRLF?

2. The proposal mentions breaking lines throughout and the term "linefeed"
only once. How are line endings treated?
- If they are normalized, is it to LF?
- If they are not normalized, how do you propose to have this interact with
git's recommended "core.autocrlf" setting, which will automatically change
your literal string if it's checked out on a different platform? (See:
https://help.github.com/articles/dealing-with-line-endings/)


• Is the problem being addressed significant enough to warrant a change to
> Swift?
>

Yes.


> • Does this proposal fit well with the feel and direction of Swift?
>

Yes--well, it needs more detail to be a fully fleshed-out proposal.


> • If you have used other languages or libraries with a similar feature,
> how do you feel that this proposal compares to those?
>

Yes--and to answer the question about how this compares, we need more
detail.


> • How much effort did you put into your review? A glance, a quick reading,
> or an in-depth study?
>

I have thought about this off and on for quite some time.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170406/b5d75889/attachment.html>


More information about the swift-evolution mailing list