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

Gwendal Roué gwendal.roue at gmail.com
Fri Apr 7 06:07:45 CDT 2017


> What is your evaluation of the proposal?

It is good, but incomplete, needs many clarifications, and could be well improved with visual examples.

Some questions:

- What's the destiny of \", \n, \t, etc? Saying that single quote don't need to be escaped is not enough.

- The sentence "This allows the developer to paste literal content directly into the string without modification" is confusing, to say the least. I guess I can't paste a literal that contains a triple quote """, for example. Other languages don't use triple-quoted strings for heredocs (which, unlike triple-quoted strings, do support blind pasting: https://en.wikipedia.org/wiki/Here_document).

- What *exactly* happens to leading and trailing newlines?

- Can we have white space characters at the end of a line in the middle of a multi-line string? Doesn't it need tooling support? (Xcode usually deletes trailing white spaces)

- Oddly enough, I don't read "Python" in the proposal. Since Python has triple-quoted strings, it may be a good idea to use their experience.

I finally suggest that the proposal comes with a detailed list of examples, including examples of *corner cases*. Readers with a visual mind will enjoy *seeing* what happens. To list a few examples where I expect the output to always be "foo", but I'm not 100%sure:

-	"""foo"""

-	"""foo
	"""

-	"""foo
		"""

-	"""	
	foo"""

-	"""
	foo
	"""

-	"""
		foo
	"""

-	"""
		foo
		"""

-	"""
		foo
			"""

I'm not asking answers to the above questions in order to feed the future Swift documentation - I need those answers in order to be able to evaluate the proposal.

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

Oh, yes! The String + operator is nice, but not enough!

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

I guess it does.

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

It's OK, but still lacks clarity.

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

Enough to get many questions.

Thanks for the proposal,
Gwendal Roué


> Le 6 avr. 2017 à 21:35, Joe Groff via swift-evolution <swift-evolution at swift.org> a écrit :
> 
> 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



More information about the swift-evolution mailing list