Skip to content
Prev 37981 / 63424 Next

Recursion error after upgrade to R_2.11.1 [Sec=Unclassified] [Sec=Unclassified]

Yes, afer the email from William Dunlop, I found this difference in the methods between 2.10.1 and 2.11.1
I had a play and by adding my own method to overload "[[<-" for my PortableObject was able to reinstate the original functionality without the recursive error.

setMethod("[[<-", "PortableObject",
        function (x, i, j, ..., value)
        {
                call <- sys.call()
                call[[2]] <- x at .Data
                eval.parent(call)
                x
        }
)
Hmmm, not sure what you mean here?  My code passes objects such as these as parameters to other S4 classes which alter their data.  If the .xData slot is used then I have no need to return the object.  No copy-on-change is performed but data held by the PortableObject is modified.  This speeds up my execution time by a LARGE amount.

I could very well have things all arse-about, having come from a Java OO background, but this is the only way I have been able to create a pass-by-reference paradigm using S4 classes.  Any suggestions for alternative solutions would be greatfully received.

Troy
___________________________________________________________________________

    Australian Antarctic Division - Commonwealth of Australia
IMPORTANT: This transmission is intended for the addressee only. If you are not the
intended recipient, you are notified that use or dissemination of this communication is
strictly prohibited by Commonwealth law. If you have received this transmission in error,
please notify the sender immediately by e-mail or by telephoning +61 3 6232 3209 and
DELETE the message.
        Visit our web site at http://www.antarctica.gov.au/
___________________________________________________________________________