HenrikBengtsson / listenv

R package: listenv - Environments Behaving As Lists
https://listenv.futureverse.org
30 stars 2 forks source link

CONCERN: Is it safe to have attributes on environments? #32

Open HenrikBengtsson opened 8 years ago

HenrikBengtsson commented 8 years ago

Note to self: Is it safe to have attributes on environments? It might not be, cf. https://github.com/wch/R6/issues/64 and https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=16441.

UPDATE: I'm pretty sure I went through this discussion back in ~2001/2 for the R.oo package. The Object:s in R.oo basically uses:

x <- NA
attr(x, "envir") <- new.env()
class(x) <- c("Object")

such that attributes are not attached to the environment. However, I'm not sure if this is related.