On Apr 12, 2017, at 07:52, Thorsten Seitz via swift-evolution 
<[email protected]> wrote:

>> Am 12.04.2017 um 15:40 schrieb Brent Royal-Gordon via swift-evolution 
>> <[email protected]>:
>> 
>> Hey folks,
>> 
>> 
>> We've revised the proposal again. The main difference: You no longer need an 
>> initial newline to enable indentation stripping, and stripping no longer 
>> removes that newline even if it is present. (Adrian Zubarev and I believe 
>> some others argued for this.) We
> 
> Hmm, not sure if I like these changes. I expect that almost all strings won't 
> begin with a newline and a majority won’t end with a newline. The new design 
> would require a leading backslash almost all the time and a trailing 
> backslash often, which is ugly:
> 
> let mystring = "““\
>    text text
>    text text\
>    "““

(I think I've read the whole thread, but it can be easy to miss parts on the 
phone. I think this is different than what's already been discussed... sorry if 
this has already been suggested and I just missed it.)

What having this input:
> let mystring = "““
>    text text
>    text text
>    "““

yielding this output:
> text text
> text text

And this input:
> let mystring = "““/
>    text text
>    text text
>    /"““

yielding this output:
> 
> text text
> text text
> 

(Sorry about not putting in all the symbols... I don't know a way to type them 
on my phone)

If you think of the "/" as more of a "toggle whether the next character is 
escaped" instead of specifically "escape the next character", it makes sense 
(kinda)... or the outputs could be reversed. Either way, it allows easy access 
to both options and preserves the "paste-in block of text as-is" goal.

- Dave Sweeris
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to