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

Jarod Long swift at lng.la
Thu Apr 6 18:09:20 CDT 2017


> • What is your evaluation of the proposal?

I like the feature a lot, but I'm not so sure about the described indentation-stripping behavior. I don't think that putting the closing """ at the same indentation level as the string's contents is very intuitive. It feels a bit like writing this:

if someCondition {
    print("message")
    }

In general, the closing delimiter in a multiline context (for lack of a better general term) is indented to the same level as the line that contains the opening delimiter, so I think that unless developers are explicitly taught otherwise, they would likely default to that style for multiline strings, resulting in confusion about why there's an extra level of indentation in the interpreted multiline string.

I think what would be more intuitive and stylistically flexible would be to strip the largest amount leading whitespace that is common to each line. In other words, whichever line(s) that have the least amount of leading whitespace would determine the amount of indentation that gets stripped.

Apologies if this approach has been discussed before -- I missed most of the discussion that led to the proposal. Any thoughts on this?

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

Yes -- this would be a very useful feature in some situations.

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

I think so.

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

I haven't used this feature enough in other languages to comment here.

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

I read the proposal thoroughly.

Jarod

On Apr 6, 2017, 12:35 -0700, Joe Groff via swift-evolution <swift-evolution at swift.org>, wrote:
> Hello Swift community,
>
> The review of SE-0168 "Multi-Line String Literals" begins now and runs through April 12, 2017. The proposal is available here:
>
> > https://github.com/apple/swift-evolution/blob/master/proposals/0168-multi-line-string-literals.md
>
> Reviews are an important part of the Swift evolution process. All reviews should be sent to the swift-evolution mailing list at:
>
> > https://lists.swift.org/mailman/listinfo/swift-evolution
> >
> or, if you would like to keep your feedback private, directly to the review manager. When replying, please try to keep the proposal link at the top of the message:
>
> > Proposal link:
>
> > > https://github.com/apple/swift-evolution/blob/master/proposals/0167-swift-encoders.md
>
> > Reply text
> > Other replies
>
> What goes into a review?
>
> The goal of the review process is to improve the proposal under review through constructive criticism and, eventually, determine the direction of Swift. When writing your review, here are some questions you might want to answer in your review:
>
> • What is your evaluation of the proposal?
> • Is the problem being addressed significant enough to warrant a change to Swift?
> • Does this proposal fit well with the feel and direction of Swift?
> • If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?
> • How much effort did you put into your review? A glance, a quick reading, or an in-depth study?
>
> More information about the Swift evolution process is available at:
>
> > https://github.com/apple/swift-evolution/blob/master/process.md
>
> Thank you,
>
> -Joe
> Review Manager
> _______________________________________________
> 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/20170406/7e6b4e4c/attachment.html>


More information about the swift-evolution mailing list