From h.wickham at gmail.com  Fri Jun 16 21:10:20 2017
From: h.wickham at gmail.com (Hadley Wickham)
Date: Fri, 16 Jun 2017 14:10:20 -0500
Subject: [Rd] [WISH / PATCH] possibility to split string literals across
 multiple lines
In-Reply-To: <CABtg=K=QBhSwhL4eJZH9Zq_JPCidTvK7ZSoUEXUQTutT8D4fkQ@mail.gmail.com>
References: <mailman.5.1497607202.2257.r-devel@r-project.org>
 <20170616180425.GA24745@mail.cs.toronto.edu>
 <CABtg=K=QBhSwhL4eJZH9Zq_JPCidTvK7ZSoUEXUQTutT8D4fkQ@mail.gmail.com>
Message-ID: <CABdHhvGXmZGh+K21HO_4x4sV3MHEZySvBUBhgNkN_5KDGYzL8Q@mail.gmail.com>

On Fri, Jun 16, 2017 at 1:14 PM, G?bor Cs?rdi <csardi.gabor at gmail.com> wrote:
> On Fri, Jun 16, 2017 at 7:04 PM, Radford Neal <radford at cs.toronto.edu> wrote:
>>> On Wed, 14 Jun 2017, G?bor Cs?rdi wrote:
>>>
>>> > I like the idea of string literals, but the C/C++ way clearly does not
>>> > work. The Python/Julia way might, i.e.:
>>> >
>>> > """this is a
>>> > multi-line
>>> > lineral"""
>>>
>>> luke-tierney at uiowa.edu:
>>
>>> This does look like a promising option; some more careful checking
>>> would be needed to make sure there aren't cases where currently
>>> working code would be broken.
>>
>> I don't see how this proposal solves any problem of interest.
>>
>> String literals can already be as long as you like.  The problem is
>> that they will get wrapped around in an editor (or not all be
>> visible), destroying the nice formatting of your program.
>
> From the Python docs:
>
> String literals can span multiple lines. One way is using
> triple-quotes: """...""" or '''...'''. End of lines are automatically
> included in the string, but it?s possible to prevent this by adding a
> \ at the end of the line.

And additionally, in Julia triple quoted strings:

Trailing whitespace is left unaltered. They can contain " symbols
without escaping. Triple-quoted strings are also dedented to the level
of the least-indented line. This is useful for defining strings within
code that is indented. For example:

Hadley

-- 
http://hadley.nz



[Rd] [WISH / PATCH] possibility to split string literals across multiple lines
Hadley Wickham