You could try {constructive} : https://github.com/cynkra/constructive/
Here's how it might help:
```
E <- new.env()
fun <- function(x) x
environment(fun) <- E
O <- list(
a = 1,
b = fun
)
# remotes::install_github("cynkra/constructive")
library(constructive)
construct(E)
#> constructive::env(
On 24 May 2023 at 09:09, Ivan Krylov wrote:
| On Wed, 24 May 2023 02:08:25 +0200
| wrote:
| > Is there a better way to do this?
|
| The .Call() interface (where functions take an arbitrary number of
| native R objects and return a native R object) combined with external
| pointers is likely to