[Rd] RHS of assignment is evaluated eagerly?

Peter Meilstrup peter.meilstrup at gmail.com
Fri Dec 27 04:26:21 CET 2013


Is this expected behavior, and if so, why? I would have expected
neither 'arg' nor 'value' to evaluate until forced.

`test<-` <- function(obj, arg, value) {
  1 #force no args
}
x <- 1
test(x, print("evaled arg")) <- print("evaluated value")

## [1] "evaluated value"

Peter



More information about the R-devel mailing list