Greetings,

Noticed that starting with R version 4.1.0, the base environment is locked by default. So for example in interactive mode, we have

> .BaseNamespaceEnv$foo <- "bar"
Error in .BaseNamespaceEnv$foo <- "bar" :
  cannot add binding of 'foo' to the base environment

However it appears that when operating in non-interactive mode, the locking is not actually enforced:

$ ~/R422/bin/Rscript -e "environmentIsLocked(.BaseNamespaceEnv)"
[1] TRUE

$ ~/R422/bin/Rscript -e ".BaseNamespaceEnv$foo <- 'bar'; .BaseNamespaceEnv$foo"
[1] "bar"

Just wondering if this is intentional, and if not, should I file a bug report?

Regards,

Ben

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to