search for: r_namesymbol

Displaying 2 results from an estimated 2 matches for "r_namesymbol".

Did you mean: r_namessymbol
2008 May 06
3
a R_PV problem
Dear all, When using gdb to debug my C code, I use R_PV to show the content of SEXP variables: SEXP sexp; // it is a data.frame SEXP colNames = getAttrib(sexp, R_NameSymbol); A strange thing is that after halting the program: (gdb) p R_PV(colNames) does not show the content of colNames. I am positive my code is right because if I insert "PrintValue(colNames);" in the c code, it will print the right value. My debug result shows that the variable "co...
2014 Oct 17
1
Making parent.env<- an error for package namespaces and package imports
...+++ 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 = "imports:"; + const char *name_string = CHAR(STRING_ELT(name, 0)); + if (!strncmp(name_string, imports_prefix, strlen(imports_prefix))) + return TRUE; + else +...