search for: subs_extptr_1

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

Did you mean: subs_extptr_2
2018 Mar 18
3
`@<-` modify its argument when slot is externalptr
...ith random address new_extptr <- cfunction(c(), ' SEXP val = PROTECT(ScalarLogical(1)); SEXP out = PROTECT(R_MakeExternalPtr(&val, R_NilValue, val)); UNPROTECT(2); return(out); ') setClass("S4ClassHoldingExtptr", contains = "externalptr") subs_extptr_1 <- function(x) { x at .xData <- new_extptr() x } subs_extptr_2 <- function(x) { x <- `@<-`(x, ".xData", new_extptr()) x } I expect functions "subs_extptr_1" and "subs_extptr_2" should be semantically identical. (is it right?) But...
2018 Mar 18
0
`@<-` modify its argument when slot is externalptr
...- cfunction(c(), ' > SEXP val = PROTECT(ScalarLogical(1)); > SEXP out = PROTECT(R_MakeExternalPtr(&val, R_NilValue, val)); > UNPROTECT(2); > return(out); > ') > > setClass("S4ClassHoldingExtptr", contains = "externalptr") > > subs_extptr_1 <- function(x) { > x at .xData <- new_extptr() > x > } > > subs_extptr_2 <- function(x) { > x <- `@<-`(x, ".xData", new_extptr()) > x > } > > I expect functions "subs_extptr_1" and "subs_extptr_2" should be &g...