# NOT RUN {
#good
#(THIS evaluated *before* do.something)
f <- function (x)
{ this <- THIS ()
do.something (this, x)
}
#bad
#(THIS evaluated *in* do.something)
f <- function (x)
do.something (THIS (), x)
#combined with/THAT example
f <- function (x)
{ . <- THAT ()
with (.,
do.something (attr.1, attr.2, x) )
}
# }
Run the code above in your browser using DataLab