From h.wickham at gmail.com  Fri Jun 16 15:57:30 2017
From: h.wickham at gmail.com (Hadley Wickham)
Date: Fri, 16 Jun 2017 08:57:30 -0500
Subject: [Rd] [WISH / PATCH] possibility to split string literals across
 multiple lines
In-Reply-To: <alpine.DEB.2.20.1706151118590.4244@luke-Latitude>
References: <73ec8f95-9607-80ee-0e37-ff0d739d289d@akersting.de>
 <CAF8bMcZ-6yZaxuWuKg9hQQYDJm2gnsGWiSWqu47xdoHwCjWnMA@mail.gmail.com>
 <CABtg=KmhJzsbTrNTtd3XWeN=++GmgFVYD18s3BgWfnJ8Hk0MsQ@mail.gmail.com>
 <alpine.DEB.2.20.1706151118590.4244@luke-Latitude>
Message-ID: <CABdHhvFp8Au_zk86F0vVP6U7qjFPO6=FOwcqqvxhgkk32DLc_w@mail.gmail.com>

>> I don't think it is reasonable to change the parser this way. This is
>> currently valid R code:
>>
>> a <- "foo"
>> "bar"
>>
>> and with the new syntax, it is also valid, but with a different
>> meaning. Or you can even consider
>>
>> a <- "foo"
>> bar %>% func() %>% print()
>>
>> etc.
>>
>> 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"""
>
>
> 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.
>
> Another Python idea worth considering is the raw string notation
> r"xyx" that does not process escape sequences -- this would make
> writing things like regular expressions easier.

If this is something you would consider, we'd be happy to put together
a patch for review.

Hadley


-- 
http://hadley.nz



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