Displaying 2 results from an estimated 2 matches for "subs_extptr_2".
Did you mean:
subs_extptr_1
2018 Mar 18
3
`@<-` modify its argument when slot is externalptr
...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 it seems that "subs_extptr_2" will modify its argument while
"subs...
2018 Mar 18
0
`@<-` modify its argument when slot is externalptr
...ExternalPtr(&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?)
No. The are similar but not identical. It is not a good ide...