search for: r_isimportsenv

Displaying 1 result from an estimated 1 matches for "r_isimportsenv".

2014 Oct 17
1
Making parent.env<- an error for package namespaces and package imports
...as being 'undefined behaviour'? Thanks, Karl Index: src/main/builtin.c =================================================================== --- src/main/builtin.c (revision 66783) +++ src/main/builtin.c (working copy) @@ -356,6 +356,24 @@ return( ENCLOS(arg) ); } +static Rboolean R_IsImportsEnv(SEXP env) +{ + if (isNull(env) || !isEnvironment(env)) + return FALSE; + if (ENCLOS(env) != R_BaseNamespace) + return FALSE; + SEXP name = getAttrib(env, R_NameSymbol); + if (!isString(name) || length(name) != 1) + return FALSE; + + const char *imports_prefix = &...