[swift-evolution] multi-line string literals

Travis Tilley ttilley at gmail.com
Mon Dec 14 16:27:22 CST 2015


On Mon, Dec 14, 2015 at 5:14 PM, Andrey Tarantsov <andrey at tarantsov.com>
wrote:

> 2) using ' means that the string contents are unescaped/raw
>
>
> I wonder if that's too subtle. Like Chris, I would prefer advanced knobs
> to be (i) more distinctive than ' vs ", and possibly (ii) only attached to
> the advanced string type.
>

Anyone coming from ruby would feel right at home, but i'm having trouble
finding precedent in any other language for that behavior. You may be right.

Ideally, a tab character would be a syntax error in Swift, period. Eat it,
> Go.
>
> More realistically, you want to issue a syntax error if all non-empty
> lines don't share a common whitespace prefix that entirely covers at least
> one of the whitespace prefixes.
>

​I don't think it's the language's job to enforce preferences here,
especially given that holy wars have been fought over indentation (as well
as things much less important). Having 3 lines all started by the same
number of tabs, but with two having spaces as well for sub-tab-length
indentation, should never be an error.


​-Travis Tilley
​
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20151214/09e02168/attachment.html>


More information about the swift-evolution mailing list