Re: [WISH / PATCH] possibility to split string literals

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: [WISH / PATCH] possibility to split string literals

Radford Neal
> <[hidden email]>:

> 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

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel