Open lentinj opened 1 year ago
To be able to split of formula_utils, we need to have something that's actual R in place of g3_with.
g3_with
local() is the obvious candidate, replacing g3_with(var1 := val1, var2 := val2, { stock__num <- var1 * var2 }) with local({var1 <- val1 ; var2 <- val2 ; stock__num <<- var1 * var2}).
local()
g3_with(var1 := val1, var2 := val2, { stock__num <- var1 * var2 })
local({var1 <- val1 ; var2 <- val2 ; stock__num <<- var1 * var2})
However, this isn't brilliant since assignments to stock__num outside of local() will still have to use <-. Remembering which to use sounds painful.
stock__num
<-
There's also a performance concern about all the extra environments, but this could be rewritten out if required.
To be able to split of formula_utils, we need to have something that's actual R in place of
g3_with
.local()
is the obvious candidate, replacingg3_with(var1 := val1, var2 := val2, { stock__num <- var1 * var2 })
withlocal({var1 <- val1 ; var2 <- val2 ; stock__num <<- var1 * var2})
.However, this isn't brilliant since assignments to
stock__num
outside oflocal()
will still have to use<-
. Remembering which to use sounds painful.There's also a performance concern about all the extra environments, but this could be rewritten out if required.