[swift-evolution] multi-line string literals.

Chris Lattner clattner at apple.com
Wed Apr 27 15:41:47 CDT 2016


> On Apr 26, 2016, at 6:53 PM, Uli Kusterer via swift-evolution <swift-evolution at swift.org> wrote:
> 
> On 26 Apr 2016, at 08:04, Chris Lattner via swift-evolution <swift-evolution at swift.org> wrote:
>> B) Introduce a modifier character that requires a more complex closing sequence to close off the string, see C++ raw string literals for prior art on this approach.  Perhaps something like:
>> 
>> 	 Rxxx”look “ here “ I can use quotes “xxx
> 
> Can you clarify how this is different from heredoc? Because really, whether I write <<DELIMITER
> stuff
> DELIMITER
> 
> or RDELIMITER" stuff "DELIMITER
> 
> doesn't seem to make much of a difference.

It is effectively an “inline heredoc style” syntax.  The point of having it (which I’m not strongly arguing for) is only so that you can use it inline in an expression without breaking the line.

-Chris


More information about the swift-evolution mailing list