Re: [Rd] `@<-` modify its argument when slot is externalptr

2018-03-18 Thread Jialin Ma
Hi Luke, Thanks a lot for the explanation. I also noted that `@<-` will not modify the argument when the slot is ".Data". For example setClass("foo", contains = "numeric") x <- new("foo", 2) y <- x y # An object of class "foo" # [1] 2 `@<-`(x, .Data, 42) # An object of class "foo" # [1] 42 x # A

[Rd] BUG: tools::pskill() returns incorrect values or non-initated garbage values [PATCH]

2018-03-18 Thread Henrik Bengtsson
For the record, I've just filed the following bug report with a patch to https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=17395: tools::pskill() returns either random garbage or incorrect values, because the internal ps_kill() (a) it does not initiate the returned logical, and (b) it assigns t

Re: [Rd] `@<-` modify its argument when slot is externalptr

2018-03-18 Thread Lukas Stadler
> On 18.03.2018, at 15:54, luke-tier...@uiowa.edu wrote: > > x <- setClass("foo", slots = "bar") > x <- new("foo", bar = 1) > y <- x > y@bar > ## [1] 1 > `@<-`(x, bar, 2) > y@bar > ## [1] 2 > > Will be fixed soon in R-devel. > I always assumed that this behavior is intentional, in order to m

Re: [Rd] `@<-` modify its argument when slot is externalptr

2018-03-18 Thread luke-tierney
On Sun, 18 Mar 2018, Jialin Ma wrote: Dear all, I am confused about the inconsistent behaviors of `@<-` operator when used in different ways. Consider the following example: library(inline) # Function to generate an externalptr object with random address new_extptr <- cfunction(c(), ' S

[Rd] `@<-` modify its argument when slot is externalptr

2018-03-18 Thread Jialin Ma
Dear all, I am confused about the inconsistent behaviors of `@<-` operator when used in different ways. Consider the following example: library(inline) # Function to generate an externalptr object with random address new_extptr <- cfunction(c(), ' SEXP val = PROTECT(ScalarLogical(1))