[swift-evolution] multi-line string literals.

Brent Royal-Gordon brent at architechies.com
Sun May 8 17:13:28 CDT 2016


> By the way has the backtick or triple backtick been considered?

Backticks already have a meaning—they "quote" an identifier which would otherwise be taken as a keyword. 

-- 
Brent Royal-Gordon
Sent from my iPhone

> On May 8, 2016, at 2:58 PM, Ricardo Parada <rparada at mac.com> wrote:
> 
> The _" and "_  are a good alternative I think. 
> 
> For some reason the underscore bothers me: it doesn't look as good aesthetically as others, and because it is already used for a couple of other things in Swift (to make large numbers readable and as a placeholder to discard a value). 
> 
> 
> 
> 
> 
>> On May 7, 2016, at 7:24 PM, L. Mihalkovic <laurent.mihalkovic at gmail.com> wrote:
>> 
>> 
>> 
>> Regards
>> (From mobile)
>> 
>>> On May 8, 2016, at 12:49 AM, Ricardo Parada via swift-evolution <swift-evolution at swift.org> wrote:
>>> 
>>> 
>>> 
>>> It seems to me like this would take care of what is needed 99% of the time. 
>>> 
>>> I've seen many who don't favor continuation quotes. 
>>> 
>>> The other option could be triple quote """ and make the continuation quote optional. Not using the continuation quote would require the closing triple quote """
>> 
>> For having built a prototype, I've come to realize that there are more alternatives. 
>> 
>> This is some of my own tests:
>> https://gist.github.com/lmihalkovic/718d1b8f2ae6f7f6ba2ef8da07b64c1c
>> 
>> The idea of these M/e or any other similar prefix remind me of my perl days (there were a lot of these), and IMO have little to do with the rest of Swift. 
>> 
>>>> On May 7, 2016, at 9:48 AM, Brent Royal-Gordon via swift-evolution <swift-evolution at swift.org> wrote:
>>>> 
>>>> ```
>>>> // Something like:
>>>> let xml = M"<?xml version="1.0"?>
>>>>        "<catalog>
>>>>        "    <book id="bk101" empty="">
>>>>        "        <author>\(author)</author>
>>>>        "    </book>
>>>>        "</catalog>
>>>> ```
>>> _______________________________________________
>>> 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/20160508/8b3b3eb4/attachment.html>


More information about the swift-evolution mailing list