Re: [Rd] Reference Classes copy(shallow=FALSE) unexpected behavior.

2011-05-12 Thread Manuel Castejón Limas
Dear Hadley and John, My main interest in the question was to understand what was happening. Thank you very much for your clarifications and the piece of code. Manuel El 11/05/11 18:32, John Chambers j...@r-project.org escribió: Good suggestion for this case. But the general problem is

Re: [Rd] Reference Classes copy(shallow=FALSE) unexpected behavior.

2011-05-12 Thread Manuel Castejón Limas
Dear Hadley, Thank you very much for your interest in the question proposed. The Con class is a Reference Class. P and k are from class listCon. I provide in the following lines a little more detail in order to be able to reproduce the case. #Class declaration gCon - setRefClass(Con,

Re: [Rd] Reference Classes copy(shallow=FALSE) unexpected behavior.

2011-05-11 Thread Hadley Wickham
2011/5/10 Manuel Castejón Limas manuel.caste...@unileon.es: Dear all, I've just discovered the 'Reference Classes'. In a previous attempt ---a year ago--- to re-implement in a Object Oriented fashion the AMORE package using S4 classes I strongly felt the need of such capability. It's great

Re: [Rd] Reference Classes copy(shallow=FALSE) unexpected behavior.

2011-05-11 Thread Hadley Wickham
Hi Manuel, The source code for copy is short and pretty readable, so I'd encourage you to look at it: setRefClass(XXX)$copy Class method definition for method copy() function (shallow = FALSE) { def - .refClassDef value - new(def) vEnv - as.environment(value) selfEnv -

Re: [Rd] Reference Classes copy(shallow=FALSE) unexpected behavior.

2011-05-11 Thread John Chambers
Good suggestion for this case. But the general problem is tricky. What about reference objects contained in attributes or slots of other objects, etc? What is needed for total copying is a switch in the low-level duplication code that says to copy reference objects. It's also possible

Re: [Rd] Reference Classes copy(shallow=FALSE) unexpected behavior.

2011-05-11 Thread Hadley Wickham
But the general problem is tricky.  What about reference objects contained in attributes or slots of other objects, etc?  What is  needed for total copying is a switch in the low-level duplication code that says to copy reference objects.  It's also possible that one does NOT want all such

[Rd] Reference Classes copy(shallow=FALSE) unexpected behavior.

2011-05-10 Thread Manuel Castejón Limas
Dear all, I've just discovered the 'Reference Classes'. In a previous attempt ---a year ago--- to re-implement in a Object Oriented fashion the AMORE package using S4 classes I strongly felt the need of such capability. It's great to have the Reference Classes now available. Along with the