search for: scalarstr

Displaying 10 results from an estimated 10 matches for "scalarstr".

Did you mean: scalars
2020 Oct 29
2
[External] Something is wrong with the unserialize function
...=================================================================== --- src/main/altrep.c (revision 79385) +++ src/main/altrep.c (working copy) @@ -275,10 +275,11 @@ SEXP psym = ALTREP_SERIALIZED_CLASS_PKGSYM(info); SEXP class = LookupClass(csym, psym); if (class == NULL) { - SEXP pname = ScalarString(PRINTNAME(psym)); + SEXP pname = PROTECT(ScalarString(PRINTNAME(psym))); R_tryCatchError(find_namespace, pname, handle_namespace_error, NULL); class = LookupClass(csym, psym); + UNPROTECT(1); } return class; } seems to remove the warning; I'm guessing th...
2019 Nov 01
3
R C api for 'inherits' S3 and S4 objects
...ERITS(SEXP x, SEXP char_) { SEXP klass; if (isString(klass = getAttrib(x, R_ClassSymbol))) { for (int i=0; i<LENGTH(klass); i++) { if (STRING_ELT(klass, i) == char_) return true; } } return false; } // S4 inheritance bool Rinherits(SEXP x, SEXP char_) { SEXP vec = PROTECT(ScalarString(char_)); SEXP call = PROTECT(lang3(sym_inherits, x, vec)); bool ans = LOGICAL(eval(call, R_GlobalEnv))[0]==1; UNPROTECT(2); return ans; }
2019 Nov 01
4
[External] R C api for 'inherits' S3 and S4 objects
...sSymbol))) { > > for (int i=0; i<LENGTH(klass); i++) { > > if (STRING_ELT(klass, i) == char_) return true; > > } > > } > > return false; > > } > > // S4 inheritance > > bool Rinherits(SEXP x, SEXP char_) { > > SEXP vec = PROTECT(ScalarString(char_)); > > SEXP call = PROTECT(lang3(sym_inherits, x, vec)); > > bool ans = LOGICAL(eval(call, R_GlobalEnv))[0]==1; > > UNPROTECT(2); > > return ans; > > } > > > > ______________________________________________ > > R-devel at r-project.org ma...
2023 Mar 17
1
La_library() always returns "" on R-devel?
...ealpath(dl_info.dli_fname, buf); if (res) { SEXP nfo = R_NilValue; if (strstr(res, "flexiblas")) nfo = R_flexiblas_info(); if (isNull(nfo)) nfo = mkChar(""); ans = ScalarString(nfo); break; } } It will always return an empty string except for flexiblas. I assume this is not intentional. Gabor [1] https://github.com/wch/r-source/commit/77b1f5a75f8691d3e77ef07ece53f0bb6c149020#diff-b6e85dec8d7194fae29b1a1768e3f6608fa184e57f0828f48c0...
2020 Oct 29
0
[External] Something is wrong with the unserialize function
...=================================== > --- src/main/altrep.c (revision 79385) > +++ src/main/altrep.c (working copy) > @@ -275,10 +275,11 @@ > SEXP psym = ALTREP_SERIALIZED_CLASS_PKGSYM(info); > SEXP class = LookupClass(csym, psym); > if (class == NULL) { > - SEXP pname = ScalarString(PRINTNAME(psym)); > + SEXP pname = PROTECT(ScalarString(PRINTNAME(psym))); > R_tryCatchError(find_namespace, pname, > handle_namespace_error, NULL); > class = LookupClass(csym, psym); > + UNPROTECT(1); > } > return class; > } > > seems...
2020 Oct 29
2
Something is wrong with the unserialize function
Hi all, I am not able to export an ALTREP object when `gctorture` is on in the worker. The package simplemmap can be used to reproduce the problem. See the example below ``` ## Create a temporary file filePath <- tempfile() con <- file(filePath, "wrb") writeBin(rep(0.0,10),con) close(con) library(simplemmap) library(parallel) cl <- makeCluster(1) x <- mmap(filePath,
2019 Nov 01
0
[External] R C api for 'inherits' S3 and S4 objects
...gt; if (isString(klass = getAttrib(x, R_ClassSymbol))) { > for (int i=0; i<LENGTH(klass); i++) { > if (STRING_ELT(klass, i) == char_) return true; > } > } > return false; > } > // S4 inheritance > bool Rinherits(SEXP x, SEXP char_) { > SEXP vec = PROTECT(ScalarString(char_)); > SEXP call = PROTECT(lang3(sym_inherits, x, vec)); > bool ans = LOGICAL(eval(call, R_GlobalEnv))[0]==1; > UNPROTECT(2); > return ans; > } > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mai...
2006 Oct 22
1
Getting hold of a package's environment from C code
Hi, I have a package where I'm calling an R function (say "foo") from C code. "foo" is in the same package, but is not exported. I construct the call using lang1(install("foo")), but to eval it I need the package's environment. Is there a way to do this? Passing the correct environment through .Call() is not an option. Right now, I'm getting the
2019 Nov 01
0
[External] R C api for 'inherits' S3 and S4 objects
...for (int i=0; i<LENGTH(klass); i++) { >>> if (STRING_ELT(klass, i) == char_) return true; >>> } >>> } >>> return false; >>> } >>> // S4 inheritance >>> bool Rinherits(SEXP x, SEXP char_) { >>> SEXP vec = PROTECT(ScalarString(char_)); >>> SEXP call = PROTECT(lang3(sym_inherits, x, vec)); >>> bool ans = LOGICAL(eval(call, R_GlobalEnv))[0]==1; >>> UNPROTECT(2); >>> return ans; >>> } >>> >>> ______________________________________________ >>> R-d...
2016 May 12
3
Suggestion: mkString(NULL) should be NA
...n string was suddenly NULL if libcurl was built with some unusual configuration. These problems are hard to catch and I don't see any benefit of segfaulting for such edge cases. Some packages use a macro like this to protect against such problems: #define make_string(x) x ? Rf_mkString(x) : ScalarString(NA_STRING) But I think it would make sense if this was the default behavior in Rf_mkString and Rf_mkChar.