[Rd] Parser oddity with <- and =

Duncan Murdoch murdoch@dunc@n @end|ng |rom gm@||@com
Fri Feb 4 18:33:41 CET 2022


Here's an odd parse:

    a <- b = 1

This appears to be parsed as

    `<-<-`(a, b, 1)

instead of being equivalent to

    a <- b <- 1

I wonder if that's intentional?

(This showed up at https://stackoverflow.com/q/70989067/2554330, where 
it caused a lot of confusion.  I think the original intent was that `a` 
would be a macro holding `b = 1`, but I'm not sure of that.)

Duncan Murdoch



More information about the R-devel mailing list