I would think that the concatenation would get resolved at runtime, unless the 
compiler gets smart about it.  But either way I do not see it as a problem.  
The reason is that I don't remember ever worrying about the performance of 
concatenating a few lines of text.  :-)

Thanks


> On Apr 3, 2017, at 11:13 AM, Adrian Zubarev <adrian.zuba...@devandartist.com> 
> wrote:
> 
> To me a literal a single entity which is solved at compile time. The 
> concatenation is however resolved at runtime if I’m not mistaken here (it 
> might be optimized at compile time but I still would expect a function 
> executed a couple of times at runtime).
> 
> Please correct me if I’m wrong here.
> 
> 
> 
> 
> -- 
> Adrian Zubarev
> Sent with Airmail
> 
> Am 3. April 2017 um 17:10:36, Ricardo Parada (rpar...@mac.com 
> <mailto:rpar...@mac.com>) schrieb:
> 
>> How is that better than this?
>> 
>> template = "This is the first line.\n" +
>>             "This is the second line.\n" +
>>             "This is the third line."
>> 
>>> On Apr 3, 2017, at 10:42 AM, Ricardo Parada via swift-evolution 
>>> <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote:
>>> 
>>> It look prettier without the \n
>>> 
>>> It's not laziness.
>>> 
>>> I want my code to look pretty.
>>> 
>>> 
>>>> On Apr 3, 2017, at 10:40 AM, Adrian Zubarev 
>>>> <adrian.zuba...@devandartist.com <mailto:adrian.zuba...@devandartist.com>> 
>>>> wrote:
>>>> 
>>>> What I was trying to say is that by automatically adding a new line 
>>>> character does not provide any benefit except of being lazy to type \n.
>>>> 
>>>> // In your model this would be equivalent
>>>> let s1 = "\n\n\n"
>>>> let s2 = """
>>>>     " // However in my model this is an empty string and should be banned
>>>>     "
>>>>     """ // That's also an empty string, but it that case it indicates the 
>>>> end of the multi lined string
>>>> I dislike the tradeoff of precision for laziness.
>>>> 
>>>> 
>>>> 
>>>> 
>>>> -- 
>>>> Adrian Zubarev
>>>> Sent with Airmail
>>>> 
>>>> Am 3. April 2017 um 16:29:44, Ricardo Parada (rpar...@mac.com 
>>>> <mailto:rpar...@mac.com>) schrieb:
>>>> 
>>>>> By the way, the multi-line string should allow \n\n, or as many as you 
>>>>> may want to throw in there.  I don't see a problem with that.
>>>>> 
>>>> 
>>>> 
>>> 
>>> _______________________________________________
>>> swift-evolution mailing list
>>> swift-evolution@swift.org <mailto:swift-evolution@swift.org>
>>> https://lists.swift.org/mailman/listinfo/swift-evolution
>> 
> 
> 

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to