Closed sebffischer closed 7 months ago
Ok this is no bug I think but at least something that can be improved
The way crate()
is set up currently is that it only passes along variables from the surrounding environment to the crated environment. The benefit here is that the static code check done by R CMD check
will not have any problems with this.
If crate()
allowed what you are doing in your code, the code checker would admonish that the function()
is referencing a non-existent variable a
. crate()
forcing you to write it as follows is therefore a good thing:
library(mlr3misc)
l = list(a = 1)
a = l$a
crate(function() print(a), a)
thx!
Created on 2023-08-27 with reprex v2.0.2