[Rd] pass by reference for S4

2009-01-20 Thread Biczok Rudolf

Hi all;


Is it possible to modify the "@" operator that it can handle references
(or external pointers) 


of S4 Object instead of the real Objects?


Or is there any technical or compatibility issue which make it
impossible?


 


I look forward to hear from you and also hope that you don't hate me for
my nooby question.


 


Yours sincerely,


Rudolf Biczok


 


[[alternative HTML version deleted]]

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


[Rd] "for" loop wiht S4 Objects

2009-01-23 Thread Biczok Rudolf
Hi all,

 

I'm working with the S4-Class system and I have a little problem with 

Implementing iteration functionality in my S4 class but it don't work:

 

> setClass("foo",representation(bar="list"))

 

> x <- new("foo",bar=list(1,2,3))

 

>for(e in x) cat(e)

invalid type/length (S4/1) in vector allocation

 

 

But when I extend from a primitive vector it works:

 

> setClass("foo",contains="list")

 

> x <- new("foo",.Data=list(1,2,3))

 

>for(e in x) cat(e)

123

 

This is ok, but is there any other way to do this (for e.g. with a
generic function)?

 

Thanks,

Rudolf


[[alternative HTML version deleted]]

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