Re: [Rd] Should slot<-() alter its first argument?

2019-09-21 Thread Michael Lawrence via R-devel
The core of Bioconductor and the methods package itself once took advantage of this "feature" to avoid unnecessary duplication. Since the introduction of shallow copying, those abuses have been removed. Note that these assignment functions always have issues due to optimizations that assume <-()

Re: [Rd] Should slot<-() alter its first argument?

2019-09-20 Thread Benjamin Tyner
It appears this started with R version 3.5.0. Under R 3.4.4 we have: > setClass("Z", rep=representation(x="character")) > z <- new("Z", x="orig") > `@<-`(z, "x", value="newer") An object of class "Z" Slot "x": [1] "newer" > z An object of class "Z" Slot "x": [1] "newer" > `slot<-`(z, "x",

[Rd] Should slot<-() alter its first argument?

2019-09-19 Thread William Dunlap via R-devel
We noticed that the slot<- function alters its first argument, which goes against the grain of a functional language. The similar @<- does not change its first argument. Is this intended? The timeSeries and distr package depend on this altering. > setClass("Z",