On Thu, Jul 2, 2009 at 1:37 AM, Troy Robertson<troy.robert...@aad.gov.au> wrote:
> Well...
>
> My performance problems were in the pass-by-value semantics of R.
>
> I have just changed my classes to inherit from .environment and then moved 
> data members from S4 slots to the .xData objects as Martin suggested.
>

Note that the R.oo and proto packages already use environments for
their storage. e.g.

library(proto)
p <- proto(a = 1, incr = function(.) .$a <- .$a + 1)
class(p) # c("proto", "environment")

p$a # 1
p$incr()
p$a # 2

p$ls() #  c("a", "incr")
ls(p) # same

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to