[swift-evolution] [Pitch] Improve String Literals

Gwendal Roué gwendal.roue at gmail.com
Tue May 16 09:20:02 CDT 2017


I 
> Le 16 mai 2017 à 15:39, Adrian Zubarev <adrian.zubarev at devandartist.com> a écrit :
> 
> Well the main complain I had during the discussion with David was, that I previously had such a model in mind which will break up long double-quoted string literals. Please look up this design in the alternative section of our proposal. By adding slightly redundant multi-line string literal syntax for consistency renders that complain to zero. By allowing:
> 
> "
> SELECT 'name'
> FROM 'people'
> WHERE age > 20
> "
> it becomes clear that the trailing backslash should only be used for escaping new line injection in multi-line string literals, but not for breaking up long strings (similar to other languages like JavaScript):
> 
> "SELECT 'name' \
> FROM 'people' \
> WHERE age > 20"
> This also lets us adopt the C/Objective-C syntax instead. 
> 
> "SELECT 'name' "
> "FROM 'people' "
> "WHERE age > 20"

SE-0168 had one focus: long literals that contain newline characters. And it does a great job addressing it.

SE-0168 does not talk about hard wrapping. Make this the only focus of your proposal. Simplify your motivation section. Strip away redundant solutions. Become expert in hard wrapping, and please give us one correct solution. Don't forget to talk about trailing/leading newlines and text editor grammars, because those were two important discussion topics for SE-0168.

Gwendal

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170516/65ede0b3/attachment.html>


More information about the swift-evolution mailing list