From radford at cs.toronto.edu  Thu Jun 15 16:46:47 2017
From: radford at cs.toronto.edu (Radford Neal)
Date: Thu, 15 Jun 2017 10:46:47 -0400
Subject: [Rd] [WISH / PATCH] possibility to split string literals
In-Reply-To: <mailman.7.1497520801.60581.r-devel@r-project.org>
References: <mailman.7.1497520801.60581.r-devel@r-project.org>
Message-ID: <20170615144647.GA14863@mail.cs.toronto.edu>

> <csardi.gabor at 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. 

Yes.  The meaning of that would certainly need to stay the same.

However, the following is currently invalid, but would mean what is desired 
if consecutive string literals were merged by the parser, as in C:

  a <- ("foo"
        "bar")

In practice, most uses will be of something like

  cat ("I'd like to teach "
       "the world to sing"
       "\n")

which unambigously means the right thing without further effort.

So just doing like in C seems the way to go to me.

    Radford



[Rd] [WISH / PATCH] possibility to split string literals
Radford Neal